From 7b90885a3d11c1de755199804b0d175094649747 Mon Sep 17 00:00:00 2001 From: Viterbo Date: Thu, 16 Nov 2023 20:37:47 -0300 Subject: [PATCH 1/3] ensuring supportedInterfaces property when quering nfts transactions --- src/antelope/chains/EVMChainSettings.ts | 13 ++++++++++++- src/antelope/types/Filters.ts | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/antelope/chains/EVMChainSettings.ts b/src/antelope/chains/EVMChainSettings.ts index f321f6d83..3c0f3e309 100644 --- a/src/antelope/chains/EVMChainSettings.ts +++ b/src/antelope/chains/EVMChainSettings.ts @@ -423,6 +423,7 @@ export default abstract class EVMChainSettings implements ChainSettings { // process the shaped raw data into NFTs async processNftRawData(shapedRawNfts: NftRawData[]): Promise { + console.log('EVMChainSettings.processNftRawData()', shapedRawNfts); const contractStore = useContractStore(); const nftsStore = useNftsStore(); @@ -461,6 +462,7 @@ export default abstract class EVMChainSettings implements ChainSettings { const ownersUpdatedWithinThreeMins = dateIsWithinXMinutes(nft.ownerDataLastFetched, 3); if (!ownersUpdatedWithinThreeMins) { + console.log('EVMChainSettings.processNftRawData() antes de .getContractInstance()', nft.contractAddress, data, contract); const contractInstance = await (await contractStore.getContract(CURRENT_CONTEXT, nft.contractAddress))?.getContractInstance(); if (!contractInstance) { throw new AntelopeError('antelope.utils.error_contract_instance'); @@ -574,7 +576,16 @@ export default abstract class EVMChainSettings implements ChainSettings { const url = `v1/account/${account}/transfers`; return this.indexer.get(url, { params }) - .then(response => response.data as IndexerAccountTransfersResponse); + .then(response => response.data as IndexerAccountTransfersResponse) + .then((data) => { + // we recreate the supportedInterfaces property if is not pressent in the response + Object.values(data.contracts).forEach((contract) => { + if (contract.supportedInterfaces === null && type !== undefined) { + contract.supportedInterfaces = [type]; + } + }); + return data; + }); } async getTokenList(): Promise { diff --git a/src/antelope/types/Filters.ts b/src/antelope/types/Filters.ts index b5a6fd7cf..fb1aecb54 100644 --- a/src/antelope/types/Filters.ts +++ b/src/antelope/types/Filters.ts @@ -39,7 +39,7 @@ export interface IndexerTransactionsFilter extends IndexerPaginationFilter { export interface IndexerTransfersFilter extends IndexerPaginationFilter { account: string; - type?: 'erc20' | 'erc721' | 'erc1155'; // filter by token type + type?: 'erc20' | 'erc721' | 'erc1155' | 'none'; // filter by token type includePagination?: boolean; // include the total count and more flag in response endBlock?: number; // last block to include in the query startBlock?: number; // first block to include in the query From b2c47a104a667f25fade83793009c95c0263e445 Mon Sep 17 00:00:00 2001 From: Viterbo Date: Thu, 16 Nov 2023 20:46:42 -0300 Subject: [PATCH 2/3] removing console logs --- src/antelope/chains/EVMChainSettings.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/antelope/chains/EVMChainSettings.ts b/src/antelope/chains/EVMChainSettings.ts index 3c0f3e309..b8e935a60 100644 --- a/src/antelope/chains/EVMChainSettings.ts +++ b/src/antelope/chains/EVMChainSettings.ts @@ -423,7 +423,6 @@ export default abstract class EVMChainSettings implements ChainSettings { // process the shaped raw data into NFTs async processNftRawData(shapedRawNfts: NftRawData[]): Promise { - console.log('EVMChainSettings.processNftRawData()', shapedRawNfts); const contractStore = useContractStore(); const nftsStore = useNftsStore(); @@ -462,7 +461,6 @@ export default abstract class EVMChainSettings implements ChainSettings { const ownersUpdatedWithinThreeMins = dateIsWithinXMinutes(nft.ownerDataLastFetched, 3); if (!ownersUpdatedWithinThreeMins) { - console.log('EVMChainSettings.processNftRawData() antes de .getContractInstance()', nft.contractAddress, data, contract); const contractInstance = await (await contractStore.getContract(CURRENT_CONTEXT, nft.contractAddress))?.getContractInstance(); if (!contractInstance) { throw new AntelopeError('antelope.utils.error_contract_instance'); From 5ce3130b75f2b7712cc3b5a8d623e673675b8a57 Mon Sep 17 00:00:00 2001 From: Don Date: Thu, 16 Nov 2023 18:03:00 -0600 Subject: [PATCH 3/3] Update EVMChainSettings.ts --- src/antelope/chains/EVMChainSettings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/antelope/chains/EVMChainSettings.ts b/src/antelope/chains/EVMChainSettings.ts index b8e935a60..41b197d9b 100644 --- a/src/antelope/chains/EVMChainSettings.ts +++ b/src/antelope/chains/EVMChainSettings.ts @@ -576,7 +576,7 @@ export default abstract class EVMChainSettings implements ChainSettings { return this.indexer.get(url, { params }) .then(response => response.data as IndexerAccountTransfersResponse) .then((data) => { - // we recreate the supportedInterfaces property if is not pressent in the response + // set supportedInterfaces property if undefined in the response Object.values(data.contracts).forEach((contract) => { if (contract.supportedInterfaces === null && type !== undefined) { contract.supportedInterfaces = [type];