Gnosis Safe – The most trusted platform to store digital assets on Ethereum https://gnosis-safe.io
Go to file
Fernando 47d20aa645
Transaction List v2 (#1781)
* 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>
2021-02-10 17:43:23 +01:00
.github Build desktop app using latest ubuntu runner 2021-01-18 11:14:29 +01:00
.storybook New layout (#1201) 2020-08-27 18:53:28 +04:00
config Handle console erros and warnings (#1709) 2020-12-11 19:38:16 +01:00
contracts Add test case for sending token with 6 decimals, wrap moveFunds helper fireEvent in act() 2019-10-14 17:13:15 +04:00
docs Feature - Add .crypto domain resolution (#1764) 2021-01-29 13:07:47 +01:00
migrations Merge branch 'development' into 536-notifications-status-labels-sync 2020-05-22 00:36:43 -03:00
patches (Feature) - EWC/Volta ENS support on web3 patch (#1596) 2020-11-18 14:42:00 -03:00
public Update client signature 2021-01-19 13:17:15 +01:00
scripts Upgrade dependencies (#1691) 2020-12-04 18:38:49 +01:00
src Transaction List v2 (#1781) 2021-02-10 17:43:23 +01:00
.env.example (Feature) Spending Limit (#1637) 2020-11-25 15:59:17 -03:00
.eslintignore Bug: fix build directory for deployment, remove unused code (#937) 2020-05-21 08:42:11 -03:00
.eslintrc.js 1265 Restore strict null checks (#1336) 2020-09-15 09:50:51 +02:00
.gitignore Feature #1593: Support promise-based api of Safe Apps SDK (#1594) 2020-12-11 12:31:55 +04:00
.nvmrc (Fix) Enforce linting and formatting (#564) 2020-02-17 19:20:43 -03:00
.prettierignore Support Circles Safes in frontend on xDai (#1636) 2020-11-26 18:00:19 +01:00
.prettierrc (Fix) Enforce linting and formatting (#564) 2020-02-17 19:20:43 -03:00
.rescriptsrc Upgrade dependencies (#1691) 2020-12-04 18:38:49 +01:00
.travis.yml Adapt cookie banner for GDPR (#1814) 2021-02-10 11:51:20 +01:00
GNOSISCLA.md Add Gnosis CLA (#1188) 2020-07-31 13:20:57 +04:00
LICENSE.md Adding README and LICENSE (#7) 2018-03-12 11:26:53 +01:00
dev-app-update.yml Add dialog and skip version 2020-06-03 14:37:50 -03:00
package.json Transaction List v2 (#1781) 2021-02-10 17:43:23 +01:00
readme.md (Feature) - #1436 Network configuration documentation (#1533) 2020-11-05 11:21:31 +01:00
truffle.js Merge branch 'development' into 536-notifications-status-labels-sync 2020-05-22 00:36:43 -03:00
tsconfig.json (Fix) - #1798 broken safe creation deeplink (#1840) 2021-02-05 09:17:25 +01:00
yarn.lock Transaction List v2 (#1781) 2021-02-10 17:43:23 +01:00

readme.md

Gnosis Safe Multisig

The most trusted platform to store digital assets on Ethereum

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

What things you need to install the software and how to install them

yarn add truffle // recommended usage of -g flag
yarn add ganache-cli // recommended usage of -g flag
yarn add flow-type // recommended usage of -g flag

We use yarn in our infrastacture, so we decided to go with yarn in the README

Installing and running

A step by step series of examples that tell you have to get a development env running

Install dependencies for the project:

yarn install

For using the Rinkeby services:

yarn start

If you prefer using Mainnet ones:

yarn start-mainnet

Building

For Rinkeby:

yarn build

For Mainnet:

yarn build-mainnet

Running the tests

  1. Run transaction-history-service
git clone https://github.com/gnosis/safe-transaction-service.git
cd safe-transaction-service
git checkout develop
docker-compose build
# it comes enabled by default in docker-compose
sudo service postgresql stop
docker-compose up -d

Check that the service is running at https://localhost:8000

  1. Migrate Safe Contracts:
git clone https://github.com/gnosis/safe-contracts.git
cd safe-contracts
yarn
npx truffle migrate
  1. Migrate Token Contracts for the tests: Inside safe-react directory
npx truffle migrate
  1. Run the tests:
yarn test

Break down into end to end tests

Explain what these tests test and why

Give an example

And coding style tests

Explain what these tests test and why

Give an example

Deployment

Add additional notes about how to deploy this on a live system

Configuring the app for running on different networks

Please check the network configuration documentation

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See the full list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Thanks for Gnosis Team for providing the Safe contracts.