New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read tokens.json and put tokens into the correct group in Wallet tab #3581
Comments
Does this tokens.json file need to be compressed? |
Don't work on this one yet. |
@hboon Is this still on hold? |
Yes, but should be moving soon. |
@eviltofu ok, can you try this file instead (it's embedded in the comment) : https://github.com/AlphaWallet/tokens/issues/1#issuecomment-1014318436 It looks small enough after the filtering/verification. Let's just embed it in the app directly. You'll have to hunt down wallets (to watch) that contains those tokens (buzz me if you are not sure how). |
@eviltofu I forgot: do remember that the "Collectibles" tab is handled differently. I think, just ignore the tokens tagged as "Collectibles" (if there are any) in the JSON. We still show all and only ERC721 and ERC1155 in the hardcoded Collectibles tab. Otherwise it wouldn't work. (Updated the first comment to include this) |
@hboon im still trying to figure out how this screen works; where the updates are coming from etc. |
@eviltofu Sure. I think a good place to start is how Probably have to modify how this works:
Good luck :) |
Higher prority for this. Been stuck for a long time and there's a few things hanging on this. |
The
Is this correct? An issue (#4141) has been created for this. Can the file be named |
Yes
No. And it's not specifically for grouping tokens. There will be other functionality tied to it. |
@hboon Part of token.json is
What does the address field map to in
|
Yes. And the chainId to RPCServer |
@hboon are the addresses case sensitive? I see mixed cases and some instances where both cases are used in the same address.
|
@hboon some entries have no group property.
Where does a token matching this go? Assets? |
Check this out: https://eips.ethereum.org/EIPS/eip-55 The 1 specific mix of uppercase and lowercase for Ethereum addresses are a checksum for the address itself. They are the same address, but when we print them out in the app, we always use the EIP55 version (look for |
Yes, refer to #3581 (comment) |
@hboon for the following entries, both first contracts
and
|
@eviltofu looks like a bug somewhere, so you can drop the group in such cases. Can you help in to https://github.com/AlphaWallet/tokens/issues/1 and @ foxgem to describe this? |
I will only use the first occurrence and drop any future occurrences? Or will group-less entries have lower priority over entries with groups? |
Ignore entire groups that contains tokens that have already appeared in previous groups. Pretending they will be fixed at the source. |
@hboon for Collectibles, it is detected via TokenType? var type: TokenType {
get {
return TokenType(rawValue: rawType)!
}
set {
rawType = newValue.rawValue
}
} enum TokenType: String {
case nativeCryptocurrency = "ether"
case erc20 = "ERC20"
case erc875 = "ERC875"
case erc721 = "ERC721"
case erc721ForTickets = "ERC721ForTickets"
case erc1155 = "ERC1155"
init(tokenInterfaceType: TokenInterfaceType) {
switch tokenInterfaceType {
case .erc20:
self = .erc20
case .erc721:
self = .erc721
case .erc875:
self = .erc875
case .erc1155:
self = .erc1155
}
} |
Yes |
The plan now is |
I think you might need to have just have 2 of these UITableViewDataSource/UITableViewDelegate pairs because All, Assets, Defi, Governance look and work the same way whereas Collectibles is different instead of 1 pair for each tab. |
Part of #3546
Depends on: #3580
A token matches if the contract and chain ID matches an entry in each array.
This file: https://github.com/AlphaWallet/tokens/blob/main/tokens.json (check update: #3581 (comment))
"All" should contain every token that is not hidden (like it is before the PR).
If a token is not categorized, display it under "Assets".
Just ignore the tokens tagged as "Collectibles" (if there are any) in the JSON. We still show all and only ERC721 and ERC1155 in the hardcoded Collectibles tab. Otherwise it wouldn't work.
The text was updated successfully, but these errors were encountered: