diff --git a/src/components/tx-flow/flows/ExecuteBatch/ReviewBatch.tsx b/src/components/tx-flow/flows/ExecuteBatch/ReviewBatch.tsx index 9b525998e3..400661bc06 100644 --- a/src/components/tx-flow/flows/ExecuteBatch/ReviewBatch.tsx +++ b/src/components/tx-flow/flows/ExecuteBatch/ReviewBatch.tsx @@ -81,7 +81,7 @@ export const ReviewBatch = ({ params }: { params: ExecuteBatchFlowProps }) => { ? { maxFeePerGas: maxFeePerGas?.toString(), maxPriorityFeePerGas: maxPriorityFeePerGas?.toString() } : { gasPrice: maxFeePerGas?.toString() } - const humanDescription = 'Batch transaction' + const FALLBACK_HUMAN_DESCRIPTION = 'Batch transaction' await dispatchBatchExecution( txsWithDetails, @@ -90,15 +90,15 @@ export const ReviewBatch = ({ params }: { params: ExecuteBatchFlowProps }) => { onboard, safe.chainId, safe.address.value, - humanDescription, overrides, + FALLBACK_HUMAN_DESCRIPTION, ) } const onRelay = async () => { if (!multiSendTxData || !multiSendContract || !txsWithDetails) return - const humanDescription = 'Batch transaction' + const FALLBACK_HUMAN_DESCRIPTION = 'Batch transaction' await dispatchBatchExecutionRelay( txsWithDetails, @@ -106,7 +106,7 @@ export const ReviewBatch = ({ params }: { params: ExecuteBatchFlowProps }) => { multiSendTxData, safe.chainId, safe.address.value, - humanDescription, + FALLBACK_HUMAN_DESCRIPTION, ) } diff --git a/src/components/tx-flow/flows/TokenTransfer/ReviewSpendingLimitTx.tsx b/src/components/tx-flow/flows/TokenTransfer/ReviewSpendingLimitTx.tsx index e041eecab9..17de103a4b 100644 --- a/src/components/tx-flow/flows/TokenTransfer/ReviewSpendingLimitTx.tsx +++ b/src/components/tx-flow/flows/TokenTransfer/ReviewSpendingLimitTx.tsx @@ -87,10 +87,17 @@ const ReviewSpendingLimitTx = ({ setSubmitError(undefined) const txOptions = getTxOptions(advancedParams, currentChain) - const humanDescription = 'Module transaction' + const FALLBACK_HUMAN_DESCRIPTION = 'Module transaction' try { - await dispatchSpendingLimitTxExecution(txParams, txOptions, onboard, safe.chainId, safeAddress, humanDescription) + await dispatchSpendingLimitTxExecution( + txParams, + txOptions, + onboard, + safe.chainId, + safeAddress, + FALLBACK_HUMAN_DESCRIPTION, + ) onSubmit() setTxFlow(undefined) } catch (_err) { diff --git a/src/config/constants.ts b/src/config/constants.ts index 420971e1ef..a148aa3caa 100644 --- a/src/config/constants.ts +++ b/src/config/constants.ts @@ -3,8 +3,9 @@ import chains from './chains' export const IS_PRODUCTION = !!process.env.NEXT_PUBLIC_IS_PRODUCTION export const IS_DEV = process.env.NODE_ENV === 'development' -export const GATEWAY_URL_PRODUCTION = process.env.NEXT_PUBLIC_GATEWAY_URL_PRODUCTION || 'http://localhost:3030' -export const GATEWAY_URL_STAGING = process.env.NEXT_PUBLIC_GATEWAY_URL_STAGING || 'http://localhost:3030' +export const GATEWAY_URL_PRODUCTION = + process.env.NEXT_PUBLIC_GATEWAY_URL_PRODUCTION || 'https://safe-client.safe.global' +export const GATEWAY_URL_STAGING = process.env.NEXT_PUBLIC_GATEWAY_URL_STAGING || 'https://safe-client.staging.5afe.dev' // Magic numbers export const POLLING_INTERVAL = 15_000 diff --git a/src/services/tx/tx-sender/dispatch.ts b/src/services/tx/tx-sender/dispatch.ts index 72e71f411e..65fb9d8755 100644 --- a/src/services/tx/tx-sender/dispatch.ts +++ b/src/services/tx/tx-sender/dispatch.ts @@ -189,8 +189,8 @@ export const dispatchBatchExecution = async ( onboard: OnboardAPI, chainId: SafeInfo['chainId'], safeAddress: string, - humanDescription?: string, overrides?: PayableOverrides, + humanDescription?: string, ) => { const groupKey = multiSendTxData diff --git a/src/store/txHistorySlice.ts b/src/store/txHistorySlice.ts index b48551ce52..9ecbec861e 100644 --- a/src/store/txHistorySlice.ts +++ b/src/store/txHistorySlice.ts @@ -1,6 +1,6 @@ import type { listenerMiddlewareInstance } from '@/store' import type { TransactionListPage } from '@safe-global/safe-gateway-typescript-sdk' -import { isTransactionListItem } from '@/utils/transaction-guards' +import { isMultisigExecutionInfo, isTransactionListItem } from '@/utils/transaction-guards' import { txDispatch, TxEvent } from '@/services/tx/txEvents' import { selectPendingTxs } from './pendingTxsSlice' import { makeLoadableSlice } from './common' @@ -28,10 +28,15 @@ export const txHistoryListener = (listenerMiddleware: typeof listenerMiddlewareI const txId = result.transaction.id if (pendingTxs[txId]) { + const HUMAN_DESCRIPTION_FALLBACK = + 'Transaction' + + (isMultisigExecutionInfo(result.transaction.executionInfo) && `#${result.transaction.executionInfo.nonce}`) + const humanDescription = result.transaction.txInfo?.humanDescription || HUMAN_DESCRIPTION_FALLBACK + txDispatch(TxEvent.SUCCESS, { txId, groupKey: pendingTxs[txId].groupKey, - humanDescription: result.transaction.txInfo?.humanDescription, + humanDescription, }) } }