dlnHook
parameter of the create-tx
endpoint. The value for this parameter must be a JSON object that describes the
hook for the given destination chain. Depending on the destination chain, different templates are available.
Serialized instructions hook for Solana
To set the hook to be executed upon filling order on Solana (dstChainId=7565164), the following template should be used:DlnHook encoding example
DlnHook encoding example
Transaction call hook for EVM
To easily attach an atomic success-required hook that executes an arbitrary transaction call via the default Universal hook, the DLN API provides a simple shortcut for that:data.to
and data.calldata
properties represent the transaction call that should be made, as explained in the Universal hook section. The gas
property must be specified if:
- the underlying call handles errors gracefully, which leads to underestimation of gas.
- the transaction call can’t be estimated currently, which leads to inability of the DLN API to properly estimate transaction costs.
Deposit 0.1 USDC to AAVE Hook Example
Deposit 0.1 USDC to AAVE Hook Example
The following snippet produces a dlnHook parameter that results a hook to deposit 0.1 USDC to AAVE on behalf of
0xc31dcE63f4B284Cf3bFb93A278F970204409747f
:Arbitrary hook for EVM
To provide a complete customization of a hook, the DLN API offers a template that fully replicates the HookDataV1 struct:Hook validity considerations
To ensure best and frictionless user experience, the DLN API would refuse to return a transaction to create an order if it is impossible to
fulfill an order with the given hook.