TradeData constructor

const TradeData({
  1. required int chainId,
  2. required String estimatedPriceImpact,
  3. required String to,
  4. required String data,
  5. required String value,
  6. required String buyTokenAddress,
  7. required String sellTokenAddress,
  8. required String buyAmount,
  9. required String sellAmount,
  10. required String allowanceTarget,
})

Constructs a TradeData instance with detailed information about a trade.

Includes the blockchain chainId where the trade will occur, the estimatedPriceImpact which indicates the potential change in price due to the trade, to the recipient address, data the payload data of the trade transaction, value the amount of native blockchain currency (if any) to be sent with the transaction. It also requires the addresses of the buy and sell tokens, the amounts to be bought and sold, and the allowanceTarget, which is the address authorized to spend the tokens.

Implementation

const factory TradeData({
  required int chainId,
  required String estimatedPriceImpact,
  required String to,
  required String data,
  required String value,
  required String buyTokenAddress,
  required String sellTokenAddress,
  required String buyAmount,
  required String sellAmount,
  required String allowanceTarget,
}) = _TradeData;