Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensuring supportedInterfaces property when quering nfts transactions #677

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/antelope/chains/EVMChainSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,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) => {
// set supportedInterfaces property if undefined in the response
Object.values(data.contracts).forEach((contract) => {
if (contract.supportedInterfaces === null && type !== undefined) {
contract.supportedInterfaces = [type];
}
});
return data;
});
}

async getTokenList(): Promise<TokenClass[]> {
Expand Down
2 changes: 1 addition & 1 deletion src/antelope/types/Filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading