Open Keith-CY opened 2 years ago
Since we are going to use graphql in UI, maybe we can just implement them in graphql only? @zmcNotafraid @Naupio
graphql token list (udt list) enhancement link https://github.com/Magickbase/godwoken_explorer/issues/625
All APIs are ready, will be updated in front-end by 08/03
I still don't have bandwidth for these features so request help from @qiweiii and @JeffreyMa597
The main goal is simple, add order
or filter
functions in the table/list as https://www.gwscan.com/tx/0xde6f86bcead05320f667d2422985db6043aadbff3297d8cb026b7db30d84365b
ERC 20 transfer list, bridge transfer list and transaction list for @qiweiii Contract list, token list for @JeffreyMa597
Is that ok?
PS: PR for each table/list could be submitted separately.
👍
a few questions abt api @Naupio @Keith-CY :
token_transfers
does not support filter by token type/name, do we need to add this feature?combine_from_to
mean filter by both from_address
and to_address
?questions abt product/design:
from
, does it show all txs with this from address
or only this user’s txs with this from address
?a few questions abt api @Naupio @Keith-CY :
- seems
token_transfers
does not support filter by token type/name, do we need to add this feature?- Does
combine_from_to
mean filter by bothfrom_address
andto_address
?
combine_from_to: true
means filtering by from_address || to_address
, it was used as
from_address: A
to_address: A
combine_from_and_to: true // default
So transactions sent by A and transactions sent to A are all returned
questions abt product/design:
- how to allow user to choose age range, using string input format like yyyy-mm-dd or using a date picker component
- In user account page, if user filter erc20 transfers list by
from
, does it show all txs with thisfrom address
or only this user’s txs with thisfrom address
?
yyyy-mm-dd
with a datetime picker could be used, just as the native HTML component, its layout/appearance could be desicded by @Kirl70 erc20 transfers
are a group of logs
emitted by erc20 contracts
, a log looks like event Transfer(address indexed from, address indexed to, uint256 value)
(source code), when from
filter is adopted, logs
which has the specific from address
as its address indexed from
are displayed.@qiweiii
token_transfers
for erc20, erc721_token_transfers
for erc721, erc1155_token_transfers
for erc1155, token_name filter does not exist now, we can add it.address = from_address OR address = to_address
and the default value is true
, if combine_from_to set to false
, the query strategy here like address = from_address AND address = to_address
@qiweiii
Date selector style as shown in the figure, detailed time selection using the framework that comes with the component, note that the selection color needs to be consistent with the theme color of the page.
@Keith-CY @Naupio Hi, Team. I also have a few questions about this issue:
Contract list
1、Can all fields sorts be combined and used at the same time? Such as sorting by balance
in "ASC" and sorting by tx count
in "DESC" at the same time.
2、The value of sorted by balance
is missing from the sort_value
in the API.
3、Does the EX_TX_COUNT
in the sort_value
refer to the tx count
in the description?
4、In our page, I found both fetch
and graphql
are used to obtain our list data. However, we only used the loading state of graphql request, and the data in the list used the data obtained by the fetch request. I wonder if there is any historical reason for this? Do I need to make any changes?
5、Currentpage
is used for page-turning, do I need to change the cursor for page-turning?
Token list
1、Does this page means the page of Bridged Token List
? Or is the page of Layer 2 Native Token List
also included in it?
2、The name
column is not in the list, so I need to add it, right?
@Keith-CY @Naupio Hi, Team. I also have a few questions about this issue:
Contract list 1、Can all fields sorts be combined and used at the same time? Such as sorting by
balance
in "ASC" and sorting bytx count
in "DESC" at the same time.
Sure, sorters could be used together
2、The value of
sorted by balance
is missing from thesort_value
in the API. 3、Does theEX_TX_COUNT
in thesort_value
refer to thetx count
in the description?
To @Naupio
4、In our page, I found both
fetch
andgraphql
are used to obtain our list data. However, we only used the loading state of graphql request, and the data in the list used the data obtained by the fetch request. I wonder if there is any historical reason for this? Do I need to make any changes?
It should be a historical problem, we will use graphql for all network requests to backend server
5、
Currentpage
is used for page-turning, do I need to change the cursor for page-turning?
Cursors returned from the APIs are pointing to other pages, so they should be set in the link to other pages.
Token list 1、Does this page means the page of
Bridged Token List
? Or is the page ofLayer 2 Native Token List
also included in it?
Token list pages was including bridged token list
and native token list
, now it should also include erc721 token list
and erc1155 token list
2、The
name
column is not in the list, so I need to add it, right?
The name
field was changed to the token
field
@Keith-CY Thanks for your reply. There are some other questions after that:
1、Cursors returned from the APIs are pointing to other pages, so they should be set in the link to other pages.
I mean if we use grapgql request to get our data, I'll change the page-turning by using cursor.
2、Token list pages was including bridged token list and native token list, now it should also include erc721 token list and erc1155 token list
That means the whole pages in the Token
selector on the home page.
3、The
name
field was changed to thetoken
field
I found we use name
to represent the token
in our code. That means I should sort the list by using name
instead of by using token
?
4、The field of total supply is not in the list item of list 721. Do I need to add the display of this field?
I mean if we use grapgql request to get our data, I'll change the page-turning by using cursor.
Sure, pagination should be implemented with cursor instead of page number
That means the whole pages in the
Token
selector on the home page.
Yes
I found we use
name
to represent thetoken
in our code. That means I should sort the list by usingname
instead of by usingtoken
?
Correct, it's displayed with token icon/cover
but sorted by token name
4、The field of total supply is not in the list item of list 721. Do I need to add the display of this field?
total supply
could be ignored because minted count
of ERC 721 is the total supply
of ERC 20
@Naupio These values we will use to sort are missing in our APIs. Please help to add the following values, thanks.
PR for contract list: https://github.com/Magickbase/godwoken-explorer-ui/pull/735
PR for Bridge Token and Layer 2 Native Token: https://github.com/Magickbase/godwoken-explorer-ui/pull/736
PR for NFT collections: https://github.com/Magickbase/godwoken-explorer-ui/pull/737
@Keith-CY
4、The field of total supply is not in the list item of list 721. Do I need to add the display of this field?
total supply
could be ignored becauseminted count
of ERC 721 is thetotal supply
of ERC 20
How about the ERC1155?
@Keith-CY
4、The field of total supply is not in the list item of list 721. Do I need to add the display of this field?
total supply
could be ignored becauseminted count
of ERC 721 is thetotal supply
of ERC 20How about the ERC1155?
List of ERC 1155 has two special columns:
type count
: how many kinds of tokens in an ERC 1155 contractholder count
: how many users are holding this ERC 1155 tokensThese two columns should support sorting and total supply
could be ignored because type type of erc 1155
is similar to total supply of erc 20
These two columns should support sorting and total supply could be ignored because type type of erc 1155 is similar to total supply of erc 20
ok, @Naupio
total supply
could be ignored
Is that mean we don't have to use minted Count
instead of total supply
to sort?
These two columns should support sorting and total supply could be ignored because type type of erc 1155 is similar to total supply of erc 20
ok, @Naupio
total supply
could be ignoredIs that mean we don't have to use
minted Count
instead oftotal supply
to sort?
It's not necessary for the page
@Naupio The latest values we should confirm and add.
PR for Multi collections: https://github.com/Magickbase/godwoken-explorer-ui/pull/738
@Keith-CY @Naupio For bridged transfers list
fetch
to get data, I found there is a graphql api account_current_bridged_udts
provides similar data but not 100% same, also it does not provide sorter/filter input like other endpoints, do we need another api request or which endpoint should we use?@Keith-CY @Naupio For bridged transfers list
- now it's using
fetch
to get data, I found there is a graphql apiaccount_current_bridged_udts
provides similar data but not 100% same, also it does not provide sorter/filter input like other endpoints, do we need another api request or which endpoint should we use?- For current headers in this table, which column do we need to filter/sort?
It's a good time to replace the restful API with graphql API @Naupio
Sorted by age
and filtered by type
seem good to me.
@Naupio The latest values we should confirm and add.
ex_tx_count
sorter use for sort by transaction count with smart contract
list
add balance sorter link issue: #1172
add minted count sorter for erc721_udts #1173
add type count sorter for erc1155_udts #1174
@Naupio Once you finished adding these values, please tell me to finish my PR. Thanks a lot.
@Keith-CY @Naupio For bridged transfers list
- now it's using
fetch
to get data, I found there is a graphql apiaccount_current_bridged_udts
provides similar data but not 100% same, also it does not provide sorter/filter input like other endpoints, do we need another api request or which endpoint should we use?- For current headers in this table, which column do we need to filter/sort?
It's a good time to replace the restful API with graphql API @Naupio
Sorted by
age
and filtered bytype
seem good to me.
add new graphql api for deposits and withdrawals history #1186
Maybe sorting should not be composed with each other. For example, on page https://www.gwscan.com/tokens/bridge?name=&page_size=30&holder_count_sort=DESC&name_sort=DESC&supply_sort=ASC
holder count
is prior to other sorting fields, so other fields are definitely useless because most tokens have different holder count
, but they are ordered by holder count
first, which means the order is fiexed. It's impossible to list records by circulating supply
.
Correct me if I'm wrong @Naupio @JeffreyMa597 @qiweiii @FrederLu
But sorting and filtering could work together.
Yea it make sense, maybe there should be only one active sorter, so it doesn't confuse users
Multiple filters can definitely work well, so we can allow multiple filter + one sorter
@Naupio Once you finished adding these values, please tell me to finish my PR. Thanks a lot. @JeffreyMa597
issue: https://github.com/Magickbase/godwoken_explorer/issues/1172 https://github.com/Magickbase/godwoken_explorer/issues/1173 https://github.com/Magickbase/godwoken_explorer/issues/1174
pr: https://github.com/Magickbase/godwoken_explorer/pull/1257 https://github.com/Magickbase/godwoken_explorer/pull/1279 https://github.com/Magickbase/godwoken_explorer/pull/1280
Now rest PRs in QA: Magickbase/godwoken-explorer-ui#738 Magickbase/godwoken-explorer-ui#737 Magickbase/godwoken-explorer-ui#735
735/737/738 verified.
Simple ERC20 transfer list
ERC20 transfer list
Bridge transfer list
Transaction list
Contract list
PR:
Token list
PR:
@Kirl70 Please add the filter/sort component in design draft