You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -24,7 +24,11 @@ Gnosis Protocol is a fully permissionless DEX that enables ring trades to maximi
24
24
- See the balances for any token: available in their wallet and on the exchange
25
25
- Deposit and withdraw tokens to/from the exchange wallet
26
26
27
-
## Running locally
27
+
## 📚 Wiki
28
+
29
+
Learn more about Gnosis Protocol Web in the [wiki](https://github.com/gnosis/dex-react/wiki).
30
+
31
+
## 🏃♀️ Run it locally
28
32
29
33
```bash
30
34
# Install dependencies (we use Yarn but NPM should work too)
@@ -36,256 +40,36 @@ yarn start
36
40
37
41
Open http://localhost:8080 in your browser.
38
42
39
-
## Mock mode (default)
40
-
41
-
The app will run by default in **mock mode**, that means that all service implementations will be replaced by a mocked one with some fake data. This is useful for development, however it's also useful to run it with the actual implementation:
42
-
43
-
```bash
44
-
# Disable mock mode
45
-
MOCK=false yarn start
46
-
```
47
-
48
-
Alternatively, if you want to persist this behaviour, add the env var into a local `.env` file (i.e. use [.env.example](.env.example) as a template).
49
-
50
-
## Autoconnect for mock mode (default)
51
-
52
-
When running in **mock mode**, the wallet will be connected automatically - to change this behaviour run the app via:
53
-
54
-
```bash
55
-
# Disable autoconnect, for mock mode
56
-
AUTOCONNECT=false yarn start
57
-
```
58
-
59
-
Alternatively, if you want to persist this behaviour add the env var into a local `.env` file (i.e. use [.env.example](.env.example) as a template).
60
-
61
-
## Build app
43
+
## 👷♀️Build app
62
44
63
45
```bash
64
46
yarn build
65
47
```
66
48
67
49
Static files will be generated inside the `./dist` dir.
68
50
69
-
## Run tests
51
+
## 🧪 Run tests
70
52
71
53
```bash
72
54
yarn test
73
55
```
74
56
75
-
## Automatically fixing code
76
-
77
-
Manually, by running:
57
+
## 🍴Fork it
78
58
79
-
```bash
80
-
yarn lint:fix
81
-
```
59
+
**Gnosis Protocol Web** can be forked, this way any project can use its own token list, rebrand it, add new pages or modify the existing ones.
82
60
83
-
If you use Visual Studio Code, it's recommended to install [Prettier - Code formatter
84
-
](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) and add the following to your `settings.json`
61
+
Read more [here](https://github.com/gnosis/dex-react/wiki/Fork-project).
85
62
86
-
```json
87
-
"editor.codeActionsOnSave": {
88
-
"source.fixAll.eslint": true
89
-
}
90
-
```
63
+
## 🎩 Customizing components
91
64
92
-
## Testnet faucets
65
+
**Gnosis Protocol Web** allows to redefine any React component, so you can add new pages, modify the existing ones, or modify the layout and styles.
93
66
94
-
In order to get testing tokens, read up on the information here:
95
-
[faucet](./docs/faucet-info.md)
67
+
Learn about customizing components [here](https://github.com/gnosis/dex-react/wiki/Customize-Components).
96
68
97
-
## Customizing components
98
-
99
-
This app employs overrides from an alternative source (`custom/` directory) for easy swap in of imported files.
100
-
101
-
Override works for absolute paths that make use of baseUrl
102
-
That is if there are two files:
103
-
104
-
-`src/pages/About.tsx`
105
-
-`custom/pages/About.tsx`
106
-
107
-
```js
108
-
importAboutfrom'pages/About'
109
-
// will try resolving from custom/ first and failing that from src/
110
-
```
111
-
112
-
> **NOTE**: If you are forking the project, you might want to delete the [custom/.gitignore](custom/.gitignore) file so you
113
-
> can commit a config file and components inside the custom directory.
114
-
115
-
## Config
116
-
117
-
Default app configs can be found on [the default config file](./config-default.yaml)
118
-
119
-
We recommend against editing this file directly, though.
120
-
121
-
If you wish to replace any default config, create a file named `config` inside the [`custom` folder](./custom).
122
-
123
-
Both JSON and YAML formats are supported.
124
-
125
-
Simply replace any config found on [config-default](./config-default.yaml).
126
-
127
-
> **NOTE**: If you are forking the project, you might want to delete the [custom/.gitignore](custom/.gitignore) file so you
128
-
> can commit a config file and components inside the custom directory.
129
-
130
-
Below we provide details for each config.
131
-
132
-
### `name`
133
-
134
-
A single string that controls the page title and favicon metadata.
135
-
136
-
### `logoPath`
137
-
138
-
Path to favicon logo.
139
-
140
-
### `templatePath`
141
-
142
-
Path to the template html file.
143
-
144
-
### `tcr`
145
-
146
-
Tokens are dynamically loaded from the contract, but it might not be desirable to display everything in the interface.
147
-
148
-
Gnosis Protocol is a fully permissionless trading protocol for ERC-20, as such, anyone can [enable a token for trading](https://docs.gnosis.io/protocol/docs/addtoken1/). Tokens of dubious value or nature or those not compatible with the ERC-20 standard may also be added. Accordingly, it is the responsibility of the Site operator to determine which tokens listed on the permissionless Gnosis Protocol are displayed on their Site.
149
-
150
-
To dynamically control which tokens are displayed without the need of a redeployment, it's possible to use a Token Curated Registry (TCR) contract per network.
151
-
152
-
The only requirement is that this contract implements the following method:
153
-
154
-
```sol
155
-
function getTokens(uint256 _listId) public view returns (address[] memory)
156
-
```
69
+
## 🦺 Testnet faucets
157
70
158
-
For a sample implementation, refer to [dxDAO's TCR](https://github.com/nicoelzer/dxDAO-Token-Registry/blob/master/contracts/dxTokenRegistry.sol).
71
+
Test faucets allow to get some tokens for using them in a testnet.
159
72
160
-
**Config format:**
161
-
162
-
```yaml
163
-
tcr:
164
-
type: 'multi-tcr'
165
-
config:
166
-
lists:
167
-
- networkId: number
168
-
listId: number
169
-
contractAddress: string
170
-
171
-
# OR, for no filtering
172
-
tcr:
173
-
type: 'none'
174
-
```
175
-
176
-
Where:
177
-
178
-
- `type` currently is either `multi-tcr` or `none` for no filter.
179
-
- `networkId`is a number, such as `1` for Mainnet, `4` for Rinkeby and so on.
180
-
- `listId`is optional and defaults to `0`
181
-
- `contractAddress`the address of the contract deployed in network `networkId`
182
-
183
-
**Note**: For networks where a TCR contract is not provided, the tokens will not be filtered.
184
-
185
-
### `dexPriceEstimator`
186
-
187
-
Endpoints for service that provides price estimation and data for the orderbook graph.
188
-
189
-
**Config format:**
190
-
191
-
```yaml
192
-
dexPriceEstimator:
193
-
type: 'dex-price-estimator'
194
-
config:
195
-
- networkId: number
196
-
url_production: string
197
-
url_develop: string
198
-
```
199
-
200
-
Where:
201
-
202
-
- `type`can only be `dex-price-estimator`.
203
-
- `networkId`is a number, such as `1` for Mainnet, `4` for Rinkeby and so on.
204
-
- `url_production`the endpoint for given `networkId` to use in production
205
-
- `url_develop`the endpoint for given `networkId` to use in development (optional)
206
-
207
-
### `theGraphApi`
208
-
209
-
Endpoints for Gnosis Protocol Subgraph.
210
-
211
-
**Config format:**
212
-
213
-
```yaml
214
-
theGraphApi:
215
-
type: 'the-graph'
216
-
config:
217
-
- networkId: number
218
-
url: string
219
-
```
220
-
221
-
Where:
222
-
223
-
- `type`can only be `the-graph`.
224
-
- `networkId`is a number, such as `1` for Mainnet, `4` for Rinkeby and so on.
225
-
- `url`the endpoint for given `networkId`
226
-
227
-
### defaultProviderConfig
228
-
229
-
Endpoint for default Ethereum network provider.
230
-
231
-
Used when a wallet is not connected and for read operations when connected through Wallet Connect.
232
-
233
-
**Config format:**
234
-
235
-
```yaml
236
-
defaultProviderConfig:
237
-
type: 'infura'
238
-
config:
239
-
infuraId: 607a7dfcb1ad4a0b83152e30ce20cfc5
240
-
infuraEndpoint: wss://mainnet.infura.io/ws/v3/
241
-
```
242
-
243
-
OR
244
-
245
-
```yaml
246
-
defaultProviderConfig:
247
-
type: 'url'
248
-
config:
249
-
ethNodeUrl: http://localhost:8383
250
-
```
251
-
252
-
Where:
253
-
254
-
- `infuraId`is your Infura id. Appended to `infuraEndpoint`.
255
-
- `infuraEndpoint`is the base url to Infura endpoint -- without the `infuraId`.
256
-
- `ethNodeUrl`is the url to an Ethereum node.
257
-
258
-
**Note**: Both values can be provided as environment variables. Respectively, `INFURA_ID` and `ETH_NODE_URL`.
259
-
260
-
### exchangeContractConfig
261
-
262
-
Exchange contract config. Used for narrowing down event queries.
263
-
264
-
**Config format:**
265
-
266
-
```yaml
267
-
exchangeContractConfig:
268
-
type: 'contractBlock'
269
-
config:
270
-
- networkId: number
271
-
blockNumber: number
272
-
```
273
-
274
-
Where:
275
-
276
-
- `type`can only be `contractBlock`.
277
-
- `networkId`is a number, such as `1` for Mainnet, `4` for Rinkeby and so on.
278
-
- `blockNumber`is the block where contract was deployed to given network
279
-
280
-
### Wallet connect
281
-
282
-
Config for wallet connect. Allows to set a different bridge.
283
-
284
-
**Config format:**
285
-
286
-
```yaml
287
-
walletConnect:
288
-
bridge: 'wss://safe-walletconnect.gnosis.io/'
289
-
```
73
+
Gnosis Protocol is deployed and fully functional in Rinkeby testnet.
290
74
291
-
Alternatively you can set the bridge by declaring the env var `WALLET_CONNECT_BRIDGE` that would take precedence over the config.
75
+
Read more [here](https://github.com/gnosis/dex-react/wiki/Testnet-faucets).
0 commit comments