Conversation
Uses TokenSymbol in assetTableCell
…to fetch-tokens-refactor
Hides UNKNOWN username when UNKNOWN
ESLint Summary View Full Report
Report generated by eslint-plus-action |
…to fetch-tokens-refactor
|
Travis automatic deployment: |
2 similar comments
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Tried to find a token in rinkeby that does have a icon, but is not in the manage list yet so I can check the icon is retrieved, but I wasn't able to find any. So I'll leave that part be approved by code review and check it working when the fix gets to mainnet |
|
Travis automatic deployment: |
…into fetch-tokens-refactor
|
@Agupane I will work on this ticket if you're ok with it :) |
ok 👍 |
…into fetch-tokens-refactor
|
Putting this on hold because of more prioritized tickets for the safe apps sdk |
| address: string | ||
| name: string | ||
| symbol: string | ||
| decimals: number | string |
There was a problem hiding this comment.
If you use this for fetching information from the backend, then be aware that this can be null. This happens if the token you try to fetch info for is a ERC721 token.
|
|
||
| try { | ||
| isERC721 = true | ||
| await ERC721Token.at(contractAddress) |
There was a problem hiding this comment.
This only checks that there is code not that the code is a ERC721 token, right? Also we are using a deprecated version of truffle-contracts, would be nice to update that to the new package (may in a different PR)
|
|
||
| const areTxsMalformed = txs.some((t) => !isTxValid(t)) | ||
|
|
||
| if (!ethToken) { |
There was a problem hiding this comment.
Why do we not return already in the same place where we check isOpen? Right now we are still setting up all the functions before we realize that we should not even render the modal.
Also should we use react hooks for all the functions we create here?
| <div className="section"> | ||
| <Heading tag="h3">Value</Heading> | ||
| <div className="value-section"> | ||
| <TokenLogo height={40} name={ethToken.name} logoUri={ethToken.logoUri as string} /> |
There was a problem hiding this comment.
why is it necessary to cast the logoUri to a string ... according to the type dev it should be already one, right?
| const submitTx = async () => { | ||
| const web3 = getWeb3() | ||
| const txRecipient = tx.contractAddress | ||
| const txRecipient = tx.contractAddress as string |
There was a problem hiding this comment.
why is the cast here required?
| onClose, | ||
| }: OwnProps): React.ReactElement | null => { | ||
| const dispatch = useDispatch() | ||
| const ethToken = useToken(ETH_ADDRESS) as Token | null |
There was a problem hiding this comment.
it feels weird to me (coming from more strongly typed languages) that we cast the return type here ... we are ignoring the NFT type and I am also not sure if undefined and null are the same :/
| </Row> | ||
| <Row align="center" margin="md"> | ||
| <Img alt="Ether" height={28} onError={setImageToPlaceholder} src={getEthAsToken('0').logoUri} /> | ||
| <TokenLogo height={28} tokenName={token?.name} tokenLogoUri={token?.logoUri} /> |
There was a problem hiding this comment.
So in the other place we check if token (which I would rename to ethToken or similar, to show that it is always eth) is null here we kind of assume that it is not, I would try to be consistent
Closes #1071
Closes #1068
May closes #1018
Closes #877
Description
TokenSymbolcomponent that let us render a symbol for the given addressgetTokenInfos, before this pr this function tried to fetch the token data from the store and then go to the blockchain. Now before going to the blockchain, it will ask the API for data, so we can fetch the symbol.unknownwithin the transactions table