Commit 014eccef authored by isstuev's avatar isstuev

address tokens: token instance info

parent 52f4e019
import type { AddressTokenBalance } from 'types/api/address'; import type { AddressTokenBalance } from 'types/api/address';
import * as tokens from 'mocks/tokens/tokenInfo'; import * as tokens from 'mocks/tokens/tokenInfo';
import * as tokenInstance from 'mocks/tokens/tokenInstance';
export const erc20a: AddressTokenBalance = { export const erc20a: AddressTokenBalance = {
token: tokens.tokenInfoERC20a, token: tokens.tokenInfoERC20a,
...@@ -59,24 +60,28 @@ export const erc721LongSymbol: AddressTokenBalance = { ...@@ -59,24 +60,28 @@ export const erc721LongSymbol: AddressTokenBalance = {
export const erc1155a: AddressTokenBalance = { export const erc1155a: AddressTokenBalance = {
token: tokens.tokenInfoERC1155a, token: tokens.tokenInfoERC1155a,
token_id: '42', token_id: '42',
token_instance: tokenInstance.base,
value: '24', value: '24',
}; };
export const erc1155b: AddressTokenBalance = { export const erc1155b: AddressTokenBalance = {
token: tokens.tokenInfoERC1155b, token: tokens.tokenInfoERC1155b,
token_id: '100010000000001', token_id: '100010000000001',
token_instance: tokenInstance.base,
value: '11', value: '11',
}; };
export const erc1155withoutName: AddressTokenBalance = { export const erc1155withoutName: AddressTokenBalance = {
token: tokens.tokenInfoERC1155WithoutName, token: tokens.tokenInfoERC1155WithoutName,
token_id: '64532245', token_id: '64532245',
token_instance: tokenInstance.base,
value: '42', value: '42',
}; };
export const erc1155LongId: AddressTokenBalance = { export const erc1155LongId: AddressTokenBalance = {
token: tokens.tokenInfoERC1155b, token: tokens.tokenInfoERC1155b,
token_id: '483200961027732618117991942553110860267520', token_id: '483200961027732618117991942553110860267520',
token_instance: tokenInstance.base,
value: '42', value: '42',
}; };
......
...@@ -3,7 +3,7 @@ import type { Transaction } from 'types/api/transaction'; ...@@ -3,7 +3,7 @@ import type { Transaction } from 'types/api/transaction';
import type { AddressTag, WatchlistName } from './addressParams'; import type { AddressTag, WatchlistName } from './addressParams';
import type { Block } from './block'; import type { Block } from './block';
import type { InternalTransaction } from './internalTransaction'; import type { InternalTransaction } from './internalTransaction';
import type { TokenInfo, TokenType } from './token'; import type { TokenInfo, TokenInstance, TokenType } from './token';
import type { TokenTransfer, TokenTransferPagination } from './tokenTransfer'; import type { TokenTransfer, TokenTransferPagination } from './tokenTransfer';
export interface Address { export interface Address {
...@@ -48,6 +48,7 @@ export interface AddressTokenBalance { ...@@ -48,6 +48,7 @@ export interface AddressTokenBalance {
token: TokenInfo; token: TokenInfo;
token_id: string | null; token_id: string | null;
value: string; value: string;
token_instance?: TokenInstance;
} }
export interface AddressTokensResponse { export interface AddressTokensResponse {
......
...@@ -4,13 +4,13 @@ import React from 'react'; ...@@ -4,13 +4,13 @@ import React from 'react';
import type { AddressTokenBalance } from 'types/api/address'; import type { AddressTokenBalance } from 'types/api/address';
import NftImage from 'ui/shared/nft/NftImage'; import NftMedia from 'ui/shared/nft/NftMedia';
import TokenLogo from 'ui/shared/TokenLogo'; import TokenLogo from 'ui/shared/TokenLogo';
import TruncatedTextTooltip from 'ui/shared/TruncatedTextTooltip'; import TruncatedTextTooltip from 'ui/shared/TruncatedTextTooltip';
type Props = AddressTokenBalance; type Props = AddressTokenBalance;
const NFTItem = ({ token, token_id: tokenId }: Props) => { const NFTItem = ({ token, token_id: tokenId, token_instance: tokenInstance }: Props) => {
const tokenLink = route({ pathname: '/token/[hash]', query: { hash: token.address } }); const tokenLink = route({ pathname: '/token/[hash]', query: { hash: token.address } });
return ( return (
...@@ -26,11 +26,10 @@ const NFTItem = ({ token, token_id: tokenId }: Props) => { ...@@ -26,11 +26,10 @@ const NFTItem = ({ token, token_id: tokenId }: Props) => {
lineHeight="20px" lineHeight="20px"
> >
<LinkOverlay href={ tokenLink }> <LinkOverlay href={ tokenLink }>
<NftImage <NftMedia
mb="18px" mb="18px"
url={ null } imageUrl={ tokenInstance?.image_url || null }
fallbackPadding="30px" animationUrl={ tokenInstance?.animation_url || null }
cursor="pointer"
/> />
</LinkOverlay> </LinkOverlay>
{ tokenId && ( { tokenId && (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment