* Add types for redux actions (#1737)
* solve errors after rebase
- added `isStoredTransaction` to differentiate tx provided to `isCancelTransaction`
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* Add types + loadGateway transactions cosumer
* add client-gateway endpoints to networks configs
* add client-gateway getters
* WIP: consume gateway-client endpoint
- added the history transactions to the store
- updated types to `/queued` and `/history` endpoints
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* add queued transactions to the store
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* add queued transactions selectors
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* WIP: display history transactions
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* WIP: arrange lists queue/history
* prevent loading data from txs-service
* cherry-pick TokenTransferAmount component
* extract queue transactions logic into a hook `useQueueTransactions`
* Add TxType and TokenTransferAmount components
Co-authored-by: fernandomg <fernando.greco@altoros.com>
* wip: history transactions
* wip: use grid to display list content
* wip: use Accordion
* wip: tx history
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* wip: tx details
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* wip: TxInfo
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* wip: TxSummary
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* wip: TxSettingsInfo
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* Wip: style owners list
Co-authored-by: fernandomg <fernando.greco@altoros.com>
* wip: Owners List
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* wip: TxInfoCreation
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* wip: stop using backOff for client-gateway requests
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* refactor
reorganize files and components
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* refactor
- Accordion implementation
- extract summaryContent to a reusable component
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* Fix prettier issue in src/config/index
* add methods names and descriptions to collapsed row
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* wip: split components to render tx-data depending on the tx type
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* add multiSend tx details
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* refactor TxData
- separate into specified components `HexEncodedData`, `MethodDetails` & `MultiSendDetails`
* remove unused imported type
* wip: infinite-scroll
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* refactor `ADD_HISTORY_TRANSACTIONS` reducer
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* implement infinite scroll pagination
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* avoid defining `page_url` param
* refactor InfiniteScroll implementation
- created a wrapper component to simplify interface
- rearranged code
* add `missingSigners` key to `ExecutionInfo` type
* add `lodash.get`
* update `useTransactionStatus` hook to support queued transactions
* use `lodash.get` to access queued objects
* add votes info to TxCollapsed
* add TxQueueCollapsed
- also update the usage of `useTransactionStatus` hook
* split `TxRow` into `TxHistoryRow` and `TxQueueRow`
* use `txLocation` instead of `title` for `QueueTxList` component
* make `TxDetails` generic
* fix queue list elements arrangement
* export `useTransactionDetails` return type
[skip ci]
* wip: group txs by nonce
[skip ci]
* request tx details on demand
[skip ci]
* display cancelling message in queued transactions only
[skip ci]
* wip: implement tree view for grouped transactions
* styled components
- reorganized
- added comments where necessary
- refactored
* refactor QueueTxList
[skip ci]
* update styled-component
[skip ci]
* refactor
- Accordion implementation
- extract summaryContent to a reusable component
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* update safe-react-components
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* update styled-component
[skip ci]
* fix most-recent list of history transactions update
* make queued transactions list scrollable
* make scrollableTarget a const
* styles fixes
- queued grouped transactions styles
- add styles to scrollbar in scrollable areas
* add safe apps info to tx lists
* wip: add action buttons to tx details
* fix column distribution for transactions rows
* display action count for multiSend transactions
* TxExpandedActions
* add action buttons
- also did a slight refactor around grouped vs. not-grouped transactions
* fix txDetails selector
* adapt button to current SRC specs
* wip: action buttons "action"
- TODO: handle the store update -> screen refresh
* fix execution/confirmation conditions
- fixed modals conditions for execution when last confirmation is able to execute
* fix tree view (no <p> as descendant of <p>)
* wip: handle transactions actions through a context provider
* provide txLocation through context
* fix `react-hooks/exhaustive-deps` warnings
* Sort history list
* Add objects utils
* add `lodash.merge` as a dependency
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* update `ADD_QUEUED_TRANSACTIONS` reducer
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* implement pagination for `queued` transactions
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* prevent rendering action modal if `txDetails` is not available
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* pending status for tx execution
* small style-based behavior fixes
* allow to identify txs to be replaced
* redirect to `gatewayTransaction`
* adjust behavior for grouped vs individual transactions
* add help links
* display execute action only when threshold is reached
* make `setActiveHover` required
* prevent `<p />` as child of `<p />`
* fix cards background colors
* revert staging config
* fix linting errors
* prevent using `no-owner` class in history list
* add `PENDING` status to confirmation transactions
This will mark as _pending_ a transaction by its id, the rest of the txs that share same nonce will remain untouched
* unify action buttons status
- created `useActionButtonsHandler` hook
- extracted `CollapsedActions` into `TxCollapsedActions` component
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* fix wording
* fix pending status
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* fix close Action modal
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* extract `addressInList` as a util function
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* fix action buttons' "disabled" status condition
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* provide proper `to` and `value` for `processTransaction` based on Transfer Type (ERC20, ERC721 or ETHER)
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* update queued transactions pointers if we reached the last page
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* use `as string` for `next` pointer
- also fixed typo
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* add JSDocs
* explicitly discard unused client-gateway headers
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
Co-authored-by: nicosampler <nf.dominguez.87@gmail.com>
* add loading status to the queue transactions list
* fix tx actions after rebase of v2.19.1
* fix issue with safe data update
* fix types issues
* skip `isCancelTransaction` tests
* fix loading status for queue transactions
* Update notifications for tx-list v2 (#1839)
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* use `sameString` to verify `method` value
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* TxDetails refactor cancelTxDetails condition
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* remove unused TxType component
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* remove unused `isReadyToExecute` function
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* Fix eslint
* Update txs details after `PENDING` status update
* remove log
* Fix send transaction because of removed notification message
* Cleanup pending unwanted notifications
* wip: ellipsis actions
* wip: ellipsis actions - fix tokenAmount
* Refactor to txInfoDetails
* refactor `TxInfoDetails`
* remove old `utils.tsx` file
* support SpendingLimit transactions
* fix `isSpendingLimitMethod`
* Fix styles for tx list v2 (#1859)
Co-authored-by: fernandomg <fernando.greco@gmail.com>
Co-authored-by: Agustín Longoni <agustin.longoni@altoros.com>
* wip: performance enhancement
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
Co-authored-by: nicosampler <nf.dominguez.87@gmail.com>
* wip: extract data calculation to a hook
* refactor huge ternaries
* fix columns styles for small screens
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* add extra information for `Cancel` transaction identification
* undo custom selector
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
* undo custom selector
* Pass `action` by prop to TxDetails
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
Co-authored-by: nicosampler <nf.dominguez.87@gmail.com>
* Unify `processTransaction` / `createTransaction` actions
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
Co-authored-by: nicosampler <nf.dominguez.87@gmail.com>
Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
* Disable send again when the user is offline
* set pending status for the executed tx only (not the group by nonce)
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
Co-authored-by: nicosampler <nf.dominguez.87@gmail.com>
Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
* Use gatewayTransactions as default transaction list
* fix styles for TxDetails row
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
Co-authored-by: nicosampler <nf.dominguez.87@gmail.com>
Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
* Remove old transactions list legacy code
Move gatewayTransactions within transactions folder
* Remove allTransactions legacy code
* Types
* Fix redirect after createTransaction
* fix performance issue for `ApproveTxModal`
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
Co-authored-by: nicosampler <nf.dominguez.87@gmail.com>
Co-authored-by: Agustin Pane <agustin.pane@gmail.com>
* fix asset icon size
* fix status wording
* add time tooltip
* add _breadcrumb_
* properly identify non existing nonce
* fix open cookie banner types after merge
* add isCancellation flag support
* fix expanded tx styles
Co-authored-by: Mati Dastugue <matiasdastugue@gmail.com>
Co-authored-by: Mati Dastugue <mdastugu@amazon.com>
Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
Co-authored-by: nicosampler <nf.dominguez.87@gmail.com>
Co-authored-by: Mati Dastugue <matias.dastugue@altoros.com>
Co-authored-by: Agustin Pane <agustin.pane@gmail.com>
Co-authored-by: nicolas <nicosampler@users.noreply.github.com>
Co-authored-by: Agustín Longoni <agustin.longoni@altoros.com>
* Update cookie banner action and reducer
* Add cookie banner new assets
* Update cookie banner
* Update cookie banner migration
* Disable cookie banner and intercom in desktop app
* Use google analytics hook in Open Safe component
Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
* Enables validation of safeTxGas < gasLimit and enable change of the gasLimit
* - Let the user use a custom safeTxGas for checking if the transaction will fail
* Updates the gas success estimation when the user changes the safeTxGas manually on:
- Approve safeApp transaction
* Send manual parameters (safeTxGas and safeNonce) to safe apps
* Add missing variable to estimateGasForTransactionCreation
* Improve network naming usage for validation
* calculate eth value from array of txs
* use 0 incase of multisend
Co-authored-by: Agustin Pane <agustin.pane@gmail.com>
Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
* Add types for SafeProps
Adds getSafePropsValuesFromQueryParams implementation
Replaces window.location with useLocation hook
* Replaces SafeProps with import in Layout.tsx
Adds downlevelIteration to tsconfig.json to allow array.entries()
* Type createSafe()
* SafeDeployment Types
* Type Paragraph and refactor to functional component
* Fix validateQueryParams and types
Co-authored-by: nicolas <nicosampler@users.noreply.github.com>
Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
* Update copy during onboarding
Quite a few users have pointed out that it was not clear that owners can be changed after the Safe is created. E.g. "- Once I’ve created a wallet, it seems it’s possible to revoke and change a signer, but it wasn’t immediately clear if I can change the threshold."
Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
* Makes getGasEstimationTxResponse exportable
* Add check for failing txs on approveTxModal
* Adds styles for reviewTx
* Adds useTxSuccessCheck hook
* Remove hook
* Adds checkIfTxWillFail function
* Uses checkIfTxWillFailAsync on reviewTx modal
* Improves approveTx modal
* Add check for failing transaction in contract interaction modal
* Add check for reviewCollectible
* Fix check on sendFunds reviewTx
* Adds styling for contractInteraction modal
* Fix gas calculation for native token transfers
* Remove logs
* Rename estimateDataGasCosts to parseRequiredTxGasResponse
Adds getPreValidatedSignatures
Refactor estimateTxGasCosts
Refactor checkIfExecTxWillFail
* Refactor checkIfExecTxWill usage
* Refactor checkIfTxWillFailAsync in ReviewTx
* Use getPreValidatedSignatures in createTransaction()
* Refactor estimateTxGasCosts
Rename estimateSafeTxGas to estimateExecTransactionGas
* Refactor ReviewTx: extract useEffects to hooks
* Remove unnecessary gas transfer amount
* Refactor estimateTxGasCosts: extract checkIfTxIsExecution and estimateTxGas
* Fix tx amount
Remove console log
* Moves useCheckIfTransactionWillFail to logic/hooks folder
* Replaces useEffect usage with useCheckIfTransactionWillFail hook
Also fix how some modals fetch the safeAddress
* Improves modal's wording
* Remove comment
* Fix error parsing the cancel transaction error message from GETH nodes
* Remove useCheckIfTransactionWillFail
Adds useEstimateTransactionGas
Renames estimateTxGas to estimateTransactionGas
Removes estimateTxGasCosts
Removes checkIfExecTxWillFail
* Replace useCheckIfTransactionWillFail from modals with useEstimateTransactionGas
* Replace estimateGasCosts from every review tx modal with useEstimateTransactionGas
* Replace estimateGasCosts from every review tx modal with useEstimateTransactionGas
* Extract isExecution calculation to useEstimateTransactionGas
* Creates TransactionFailText
* Uses TransactionFailText in the review modals
* Remove unnecessary styles
* Fix imports
* Remove css
* Fix missing style
* Remove duplicated function
* Fix modal height
* Fix wrong selector usage
* Fix missing null check on cancel tx confirmations
* Add guard for CLOSE_SNACKBAR action when tx was already dismissed
* Improves useEstimateTransactionGas in review custom tx and contract interaction review
* Fix hook dependency
* Add active screen types in send modal
* SafeInfo: replace AddressInfo by EthHashInfo
* Fix review replace/remove/add owner modals styling
* AdvancedOptions without funcionality
* change button text
* fix margins and texts
* fix close button margin
* rename ReviewTx by ReviewSendFundsTx
* safe params: partial implementation
* make use of useTransactionParameters hook
* Refactor response of useEstimateTransactionGas
* Remove safeAddress as param to the useEstimateTransactionGas
* Improves how threshold is obtained in useEstimateTransactionGas.tsx
* Rename gasCostHumanReadable to gasCostFormatted
* Add operation to useEstimateTransactionGas
* Refactor ConfirmTransactionModal to use useEstimateTransactionGas
* Refactor proccessTransaction to use getPreValidatedSignatures method
* Fix default export of ApproveTxModal
* Rename estimateExecTransactionGas to estimateGasForTransactionCreation
Remove estimateTransactionGas from gas.ts
* form, accordion, validations
* Make estimateGasForTransactionCreation throw error instead of 0 gas
* Adds estimateGasForTransactionExecution and estimateGasForTransactionApproval to gas.ts
* Move estimateTransactionGas to useEstimateTransactionGas
Refactors useEstimateTransactionGas to return isCreation and isOffChainSignature
* Add in contractInteraction
* review custom TX
* review collectible
* Type and refactor generateSignaturesFromTxConfirmations
Moves getPreValidatedSignatures to safeTxSigner.ts
* Uses confirmations to estimateGasForTransactionExecution
* Adds TransactionFeesText component
Uses TransactionFeesText on ApproveTxModal
* Update text
* Update text
* Remove unnecessary condition
* Pass more parameters to estimateGasForTransactionExecution
* Removes unnecessary parameter in getNewTxNonce
* Moves checkIfOffChainSignatureIsPossible to safeTxSigner.ts
* rename AdvancedOptions and add parameters in add owner
* replace owner - remove owner
* Fix check for null confirmations
* Uses checkIfOffChainSignatureIsPossible on createTransaction.ts
* Policies
* Move TransactionFailText inside TransactionFees component
* spending limit
* fix textfields gap and margins
* fix margins, text size and textfields disposition
* Remove unnecessary awaits
* Update Accordion comp
* Pass safeTxGas to useEstimateTransactionGas.tsx
Improves how we use default params
* Fix gas iteration on estimateGasForTransactionExecution
* Fix estimateGasForTransactionExecution calculation
* Fix generateSignaturesFromTxConfirmations calculation
* Remove unnecessary Promise and await
* Fix estimateGasForTransactionExecution for preApproving owner case
* Improve logging
* Remove log
* Fix typo
* merge fixes
* Uses operation in useEstimateTransactionGas
* Uses operation in useEstimateTransactionGas
* add txParameters in ApproveTx
* useEstimateTransactionGas add gasPriceFormatted
* reviewSendFundsTx gasFormatted
* add gasLimit to useEstimateTransactionGas
* Files movement - EditParameters refactor
* tx parameters in creation
* set correct gasPrice
* createTx from contractInteraction
* Fix gas estimation for transaction creation
* disable button while calculating gas
* Add owner - reactor and creation options
* Add owner: remove unused code
* Threshold settings
* fix modal ui bug (tx)
* fix modal ui bug (settings)
* fix modal ui bug (Settings: Policies )
* fix ui bug modal (Spending Limit)
* (Fix) - Calculates gas for SpendingLimit transactions (#1773)
* Bug: Use link tag instead of javascript navigation in apps list (#1770)
* Use list instead of programmable navigation
* add declaration for styled-components theme
* (Fix) - Calculates gas for SpendingLimit transactions (#1773)
* Calculates gas for spendingLimit transactions
* Adds TransactionFees component inside UpdateSafeModal
* Fix send collectible gas calculation
Co-authored-by: Mikhail Mikheev <mmvsha73@gmail.com>
* speding limits
* Remove default exports for spendingLimits
* Fix warning in TxParametersDetail
* Extracts calculateSpendingLimitsTxData logic and add types
* Remove txParameters from setSpendingLimitMultiSendTx/spendingLimitMultiSendTx
Adds log for transaction creation success
* Refactor handleSubmit, now uses calculateSpendingLimitsTxData to calculate the spendingLimit transaction data before submitting
Also calculateSpendingLimitsTxData is used to estimate the amount of gas that the transaction will cost
* disable parameters when needed
* fix parametersStatus condition
* Some fixes
* more fixes
* send directly when tx nonce == safeNonce
* fix tests
* parameters in replace owner and remove owner
* Fix gas estimation issues for Metamask
* FIx Edit transaction parameters src route
* Remove default exports RemoveModuleModal
* Adds advanced parameters in RemoveModuleModal
* Fix css styling of UpdateSafeModal
* Adds EditableTxParameters within UpdateSafeModal
* Fix warning in <Accordion> for compact parameter
* Add advanced settings for RemoveLimitModal.tsx
* Fix txNonce usage in RemoveModuleModal.tsx
* Remove logs
* Fix txNonce param in RemoveLimitModal.tsx
* Remove TODOS for refactoring default case of getParametersStatus in EditableTxParameters
* Add advanced parameters to Safe apps modal
* Force gasPrice and safeTxGas 0 for cancelling transaction
* Invert validation of safeTxGas > ethGasLimit, safeTxGas should be < than ethGasLimit
* Add missing validation for approveTxModal submit button
* Fix checkIfTxIsApproveAndExecution method
Add tests
* Remove duplication of gas value for calculateGasOf
* Fix gas estimation for execution & approval
* Adds EXTRA_NODE_GAS for the gasLimit calculation
* Revert duplicate of web3.eth.estimateGas
* Revert fix of execution & approval
* Adds closeEditModalCallback in EditableTxParameters
* Accept manual gas price in useEstimateTransactionGas.tsx
* Use manualPrice in sendFunds gas estimation
* Add safeTxGas estimation to Editable TX Parameters
* Set safeTx gasPrice to 0 on tx creation
* Refactor useTransactionParameters with initialValues support
* Refactor EditableTxParameters.tsx, fixs changing gasLimit or gasPrice
* Fix safeTxGas
* Add naming to minimum gas required for a transaction
* Remove log
* Fix nonce calculation for cancel transaction
* Update gas estimation to be more precise and avoid reverts
* Check that only the creator of the transaction or the executor could modify the advanced parameters
* Add validation to submit buttons on modals when the gas estimation is loading
* Fix advanced parameters display in change threshold
* Fix wrong commit
Co-authored-by: Agustin Pane <agustin.pane@gmail.com>
Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
Co-authored-by: Fernando <fernando.greco@gmail.com>
Co-authored-by: Agustín Longoni <agustin.longoni@altoros.com>
Co-authored-by: Mikhail Mikheev <mmvsha73@gmail.com>
* Guard for empty result
* Type TextField
* Fix warning of InputAdornment in SendFunds modal
* Re-enable gas estimation for wallet connect
* Replace web3.call on parseRequiredTxGasResponse with axios post to infura
* Adds estimateGasWithInfura and estimateGasWithWeb3Provider for changing the estimation method if we are in a non-infura-supported network
* Revert calculateMinimumGasForTransaction change to leave the change for the already-open pr
* Renames estimateGasWithInfura with estimateGasWithRPCCall
Replaces web3 with web3ReadOnly in estimateGasWithRPCCall
Co-authored-by: Mati Dastugue <matias.dastugue@altoros.com>
Co-authored-by: Fernando <fernando.greco@gmail.com>
Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
* Adds isTupleParameter validation to the extractMethodArgs
* Improves tuples parsing
* Show examples for txs inputs
* Remove MethodsInputExamples
Co-authored-by: Mati Dastugue <matias.dastugue@altoros.com>
* Don't use multisend if txs.length = 1
* calc txData inside useMemo
* fix sending txs from apps, use correct operation/recipient
Co-authored-by: Fernando <fernando.greco@gmail.com>
Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
* Fix checkIfTxIsExecution method implementation
* Add tests for checkIfTxIsExecution/checkIfTxIsCreation/checkIfTxIsApproveAndExecution/
* Minimice number of ifs with same result
Co-authored-by: Mati Dastugue <matias.dastugue@altoros.com>
Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>