IFeeAdapterV2

Git Source

Functions

newIntent

Creates a new intent with fees

function newIntent(
    uint32[] memory _destinations,
    bytes32 _receiver,
    address _inputAsset,
    bytes32 _outputAsset,
    uint256 _amount,
    uint256 _amountOutMin,
    uint48 _ttl,
    bytes calldata _data,
    FeeParams calldata _feeParams
) external payable returns (bytes32, Intent memory);

Parameters

NameTypeDescription
_destinationsuint32[]Array of destination domains, preference ordered
_receiverbytes32Address of the receiver on the destination chain
_inputAssetaddressAddress of the input asset
_outputAssetbytes32Address of the output asset
_amountuint256Amount of input asset to use for the intent
_amountOutMinuint256Amount expected in the outputAsset
_ttluint48Time-to-live for the intent in seconds
_databytesAdditional data for the intent
_feeParamsFeeParamsFee parameters including fee amount, deadline, and signature

Returns

NameTypeDescription
<none>bytes32_intentId The ID of the created intent
<none>Intent_intent The created intent object

Structs

FeeParams

struct FeeParams {
    uint256 fee;
    uint256 deadline;
    bytes sig;
}

Intent

struct Intent {
    bytes32 initiator;
    bytes32 receiver;
    bytes32 inputAsset;
    bytes32 outputAsset;
    uint32 origin;
    uint64 nonce;
    uint48 timestamp;
    uint48 ttl;
    uint256 amount;
    uint256 amountOutMin;
    uint32[] destinations;
    bytes data;
}