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
Copy file name to clipboardexpand all lines: doc/Info.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -4,21 +4,21 @@ A brief overview how Info part of PancakeSwap website works.
4
4
5
5
## Code structure
6
6
7
-
In terms of React components Info section is just another view (located in [src/views/Info](../src/views/Info)) that is assigned route (in [App.tsx](../src/App.tsx)).
8
-
There are also some Info-related components inside [src/components](../src/components) (InfoNav, InfoCharts, InfoTables and InfoSearch at the time of writing).
7
+
In terms of React components Info section is just another view (located in [apps/web/src/views/Info](../apps/web/src/views/Info)) that is assigned route (in [pages](../apps/web/src/pages)).
8
+
There are also some Info-related components inside [apps/web/src/components](../apps/web/src/components) (InfoNav, InfoCharts, InfoTables and InfoSearch at the time of writing).
9
9
10
-
There are helper functions to handle data formatting and requests - [src/utils/infoDataHelpers.ts](../src/utils/infoDataHelpers.ts) and [src/utils/infoQueryHelpers.ts](../src/utils/infoQueryHelpers.ts)
10
+
There are helper functions to handle data formatting and requests - [apps/web/src/views/Info/utils/infoDataHelpers.ts](../apps/web/src/views/Info/utils/infoDataHelpers.ts) and [apps/web/src/views/Info/utils/infoQueryHelpers.ts](../apps/web/src/views/Info/utils/infoQueryHelpers.ts)
11
11
12
-
Info section has it's own reducer in Redux store - [src/state/info](../src/state/info). It handles all data about pools, tokens and overall protocol. The only exception is token/pool watchlist that is stored under [src/state/user](../src/state/user) reducer.
12
+
Info section has it's own reducer in Redux store - [apps/web/src/state/info](../apps/web/src/state/info). It handles all data about pools, tokens and overall protocol. The only exception is token/pool watchlist that is stored under [src/state/user](../apps/web/src/state/user) reducer.
13
13
14
-
GraphQL request logic lives under [src/state/info/queries](../src/state/info/queries) directory. Code over there handles firing requests to StreamingFast subgraph as well as formatting returned values and calculating all the derived data we need.
14
+
GraphQL request logic lives under [apps/web/src/state/info/queries](../apps/web/src/state/info/queries) directory. Code over there handles firing requests to StreamingFast subgraph as well as formatting returned values and calculating all the derived data we need.
15
15
16
16
## Requests flow
17
17
18
18
When user visits Info page the following requests are fired (names as declared in [src/state/info/queries](../src/state/info/queries)):
19
19
20
-
`overview` - gets basic protocol data like volume, liquidity and transaction count. 3 requests are fired for current, 24h ago and 48h ago data.
21
-
`overviewCharts` - gets data to show liquidity and volume charts on overview page.
20
+
`overview` - gets basic protocol data like volume, liquidity and transaction count. 3 requests are fired for current, 24h ago and 48h ago data.
21
+
`overviewCharts` - gets data to show liquidity and volume charts on overview page.
22
22
`overviewTransactions` - gets data to show transaction table on overview page
23
23
24
24
`prices` - gets BNB prices (current, 24h, 48 and 7d ago) used in calculations (see [src/hooks/useBnbPrices.ts](../src/hooks/useBnbPrices.ts))
@@ -31,6 +31,6 @@ When user visits Info page the following requests are fired (names as declared i
31
31
32
32
There are also multiple `blocks` queries to retrieve block numbers at different timestamps.
33
33
34
-
The flow is controlled by [src/state/info/updaters.ts](../src/state/info/updaters.ts). When user navigates through the site more pools and tokens are automatically loaded, (e.g. you click on BNB token and pools for BNB are loaded automatically, if you click on BNB-BTCB then BTCB token will be loaded, etc)
34
+
The flow is controlled by [apps/web/src/state/info/updaters.ts](../apps/web/src/state/info/updaters.ts). When user navigates through the site more pools and tokens are automatically loaded, (e.g. you click on BNB token and pools for BNB are loaded automatically, if you click on BNB-BTCB then BTCB token will be loaded, etc)
35
35
36
36
There are additional requests for price chart and search that are fired when user uses these features.
0 commit comments