Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(synapse-interface): link destination address in transaction #2353

Merged
merged 7 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { useIsTxReverted } from './helpers/useIsTxReverted'

interface _TransactionProps {
connectedAddress: string
destinationAddress: Address | null
originValue: number
originChain: Chain
originToken: Token
Expand All @@ -37,6 +38,7 @@ interface _TransactionProps {
/** TODO: Update naming after refactoring existing Activity / Transaction flow */
export const _Transaction = ({
connectedAddress,
destinationAddress,
originValue,
originChain,
originToken,
Expand All @@ -62,9 +64,11 @@ export const _Transaction = ({
)
const [destExplorerAddressLink, destExplorerName] = getExplorerAddressLink(
destinationChain?.id,
connectedAddress
destinationAddress ?? connectedAddress
)

console.log('destExplorerAddressLink:', destExplorerAddressLink)
bigboydiamonds marked this conversation as resolved.
Show resolved Hide resolved

const {
remainingTime,
delayedTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const _Transactions = ({
<_Transaction
key={tx.timestamp}
connectedAddress={connectedAddress}
destinationAddress={tx.destinationAddress}
originValue={Number(tx.originValue)}
originChain={originChain}
originToken={originToken}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ const StateManagedBridge = () => {
isSubmitted: false,
estimatedTime: bridgeQuote.estimatedTime,
bridgeModuleName: bridgeQuote.bridgeModuleName,
destinationAddress: destinationAddress,
})
)
try {
Expand Down
2 changes: 2 additions & 0 deletions packages/synapse-interface/slices/_transactions/reducer.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { PayloadAction, createSlice } from '@reduxjs/toolkit'
import { Address } from 'viem'

import { Chain, Token } from '@/utils/types'

/** TODO: Rename entire slice once done refactoring prior Activity flow */
export interface _TransactionDetails {
address: string
destinationAddress: Address | null
originChain: Chain
originToken: Token
destinationChain: Chain
Expand Down
2 changes: 2 additions & 0 deletions packages/synapse-interface/slices/transactions/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createAction } from '@reduxjs/toolkit'
import { Address } from 'viem'

import { BridgeTransaction } from '../api/generated'
import { Chain, Token } from '@/utils/types'
Expand All @@ -15,6 +16,7 @@ export interface PendingBridgeTransaction {
isSubmitted: boolean
estimatedTime: number
bridgeModuleName: string
destinationAddress: Address | null
}

export const addPendingBridgeTransaction =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const use_TransactionsListener = () => {
dispatch(
addTransaction({
address,
destinationAddress: tx.destinationAddress,
originTxHash: tx.transactionHash,
originValue: tx.originValue,
originChain: tx.originChain,
Expand Down
Loading