telosnetwork / telos-wallet

Native & EVM Web Wallet for transfers, staking, digital collectibles, and more
https://wallet.telos.net
Apache License 2.0
9 stars 8 forks source link

NFTs not showing since indexer update #792

Closed rozzaswap closed 6 months ago

rozzaswap commented 7 months ago
Viterbo commented 6 months ago

@rozzaswap and @tomtomcrypto

I did not find any problem with the NFTs at all. They work on the develop branch at least. What happened to be broken is the balances section. The problem is that the indexer is not returning some data that used to be included before.

In the contract data, we had this property called calldata that is not included anymore. https://api.testnet.teloscan.io/v1/account/0xa30b5e3c8Fee56C135Aecb733cd708cC31A5657a/balances?limit=50&offset=0&includePagination=false

According to those interfaces, the calldata (IndexerTokenMarketData) object was always present although it can have non-attributes inside since all are optional.

export interface IndexerTokenInfo {
    symbol: string;
    creator: string;
    address: string;
    fromTrace: boolean;
    trace_address: string;
    logoURI: string;
    supply: string;
    calldata: IndexerTokenMarketData; // <- here
    decimals: number;
    name: string;
    block: number;
    supportedInterfaces: string[];
    transaction: string;
}

export interface IndexerTokenMarketData {
    name?: string;
    price?: number;
    supply?: string;
    symbol?: string;
    volume?: string;
    holders?: string;
    decimals?: number;
    marketcap?: string;
    max_supply_ibc?: string;
    total_supply_ibc?: string;
    marketdata_updated?: string;
}

I fixed the problem in this PR: https://github.com/telosnetwork/telos-wallet/pull/793