Skip to content

Commit cd872eb

Browse files
chore: update txMeta obj if bridge tx with proper fields for src/dest tokens to read from later
1 parent d825484 commit cd872eb

File tree

1 file changed

+23
-4
lines changed
  • packages/transaction-controller/src/utils

1 file changed

+23
-4
lines changed

packages/transaction-controller/src/utils/swaps.ts

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,36 +566,55 @@ export function updateBridgeApprovalTransaction(
566566
* @param propsToUpdate.estimatedBaseFee - Estimated base fee of the transaction
567567
* @param propsToUpdate.approvalTxId - Transaction id of the approval transaction
568568
* @param propsToUpdate.destinationChainId - The hex chain ID of the destination chain
569+
* @param propsToUpdate.bridgeSteps - The steps of the bridge transaction
570+
* @param propsToUpdate.sourceTokenAmount - The raw amount of the source token
571+
* @param propsToUpdate.sourceTokenDecimals - The decimals of the source token
572+
* @param propsToUpdate.sourceTokenAddress - The address of the source token
573+
* @param propsToUpdate.destinationTokenAmount - The raw amount of the destination token
569574
* @returns The updated transaction meta object.
570575
*/
571576
export function updateBridgeTransaction(
572577
transactionMeta: TransactionMeta,
573578
{
574-
destinationChainId,
579+
sourceTokenAmount,
575580
sourceTokenSymbol,
581+
sourceTokenDecimals,
582+
sourceTokenAddress,
583+
584+
destinationTokenAmount,
576585
destinationTokenSymbol,
577-
type,
578586
destinationTokenDecimals,
579587
destinationTokenAddress,
588+
589+
type,
590+
destinationChainId,
580591
swapMetaData,
581592
swapTokenValue,
582593
estimatedBaseFee,
583594
approvalTxId,
595+
bridgeSteps,
584596
}: Partial<TransactionMeta>,
585597
): TransactionMeta {
586598
validateIfTransactionUnapproved(transactionMeta, 'updateBridgeTransaction');
587599

588600
let bridgeTransaction = {
601+
sourceTokenAddress,
589602
sourceTokenSymbol,
603+
sourceTokenAmount,
604+
sourceTokenDecimals,
605+
606+
destinationTokenAddress,
590607
destinationTokenSymbol,
591-
type,
608+
destinationTokenAmount,
592609
destinationTokenDecimals,
593-
destinationTokenAddress,
610+
611+
type,
594612
swapMetaData,
595613
swapTokenValue,
596614
estimatedBaseFee,
597615
approvalTxId,
598616
destinationChainId,
617+
bridgeSteps,
599618
};
600619
// TODO: Replace `any` with type
601620
// eslint-disable-next-line @typescript-eslint/no-explicit-any

0 commit comments

Comments
 (0)