From c4bb706e632b3c6acf622032ee92009704d58cec Mon Sep 17 00:00:00 2001 From: Khushboo Mehta Date: Mon, 28 Oct 2024 13:27:39 +0100 Subject: [PATCH] feat(addAmountOutInSentTransactions)_: Add amount out in NewRouterSentTransaction function --- services/wallet/responses/router_transactions.go | 4 +++- services/wallet/transfer/transaction_manager_route.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/services/wallet/responses/router_transactions.go b/services/wallet/responses/router_transactions.go index 1f277e428..bbc87b194 100644 --- a/services/wallet/responses/router_transactions.go +++ b/services/wallet/responses/router_transactions.go @@ -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, } diff --git a/services/wallet/transfer/transaction_manager_route.go b/services/wallet/transfer/transaction_manager_route.go index f885d7374..44b99ba90 100644 --- a/services/wallet/transfer/transaction_manager_route.go +++ b/services/wallet/transfer/transaction_manager_route.go @@ -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,