feat(addAmountOutInSentTransactions)_: Add amount out in NewRouterSentTransaction function

This commit is contained in:
Khushboo Mehta 2024-10-28 13:27:39 +01:00 committed by Anthony Laibe
parent 7617bdd2ef
commit c4bb706e63
2 changed files with 4 additions and 1 deletions

View File

@ -43,7 +43,8 @@ type RouterSentTransaction struct {
ToChain uint64 `json:"toChain"`
FromToken string `json:"fromToken"`
ToToken string `json:"toToken"`
Amount string `json:"amount"` // amount of the transaction
Amount string `json:"amount"` // amount sent
AmountOut string `json:"amountOut"` // amount that will be received
Hash types.Hash `json:"hash"`
ApprovalTx bool `json:"approvalTx"`
}
@ -66,6 +67,7 @@ func NewRouterSentTransaction(sendArgs *transactions.SendTxArgs, hash types.Hash
FromToken: sendArgs.FromTokenID,
ToToken: sendArgs.ToTokenID,
Amount: sendArgs.Value.String(),
AmountOut: sendArgs.ValueOut.String(),
Hash: hash,
ApprovalTx: approvalTx,
}

View File

@ -86,6 +86,7 @@ func (tm *TransactionManager) buildApprovalTxForPath(path *routes.Path, addressF
Gas: (*hexutil.Uint64)(&path.ApprovalGasAmount),
MaxFeePerGas: path.MaxFeesPerGas,
MaxPriorityFeePerGas: path.ApprovalPriorityFee,
ValueOut: (*hexutil.Big)(big.NewInt(0)),
// additional fields version 1
FromChainID: path.FromChain.ChainID,