Skip to content

Commit

Permalink
Move explorer to fungible assets query
Browse files Browse the repository at this point in the history
  • Loading branch information
kent-white committed Aug 24, 2023
1 parent 2dc3be8 commit 42db2a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/pages/Account/Components/CoinsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ function CoinNameCell({coin}: CoinCellProps) {
textOverflow: "ellipsis",
}}
>
{coin?.coin_info?.name}
{coin?.metadata?.name}
</GeneralTableCell>
);
}

function AmountCell({coin}: CoinCellProps) {
const amount = coin?.amount;
const decimals = coin?.coin_info?.decimals;
const decimals = coin?.metadata?.decimals;

if (!amount || !decimals) {
return <GeneralTableCell>-</GeneralTableCell>;
Expand All @@ -40,7 +40,7 @@ function AmountCell({coin}: CoinCellProps) {
<GeneralTableCell>
<span>{formattedAmount}</span>
<span style={{marginLeft: 8, color: grey[450]}}>
{coin?.coin_info?.symbol}
{coin?.metadata?.symbol}
</span>
</GeneralTableCell>
);
Expand All @@ -49,7 +49,7 @@ function AmountCell({coin}: CoinCellProps) {
function CoinTypeCell({coin}: CoinCellProps) {
return (
<GeneralTableCell sx={{width: 450}}>
<HashButton hash={coin?.coin_type} type={HashType.OTHERS} size="large" />
<HashButton hash={coin?.asset_type} type={HashType.OTHERS} size="large" />
</GeneralTableCell>
);
}
Expand Down
8 changes: 4 additions & 4 deletions src/pages/Account/Tabs/CoinsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import {CoinsTable} from "../Components/CoinsTable";

const COINS_QUERY = gql`
query CoinsData($owner_address: String, $limit: Int, $offset: Int) {
current_coin_balances(
current_fungible_asset_balances(
where: {owner_address: {_eq: $owner_address}}
limit: $limit
offset: $offset
) {
amount
coin_type
coin_info {
asset_type
metadata {
name
decimals
symbol
Expand Down Expand Up @@ -44,7 +44,7 @@ export default function CoinsTab({address}: TokenTabsProps) {
}

// TODO: add graphql data typing
const coins = data?.current_coin_balances ?? [];
const coins = data?.current_fungible_asset_balances ?? [];

if (coins.length === 0) {
return <EmptyTabContent />;
Expand Down

0 comments on commit 42db2a4

Please sign in to comment.