Skip to content

Commit 09db690

Browse files
committed
support hybrid nft
1 parent fb66748 commit 09db690

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

stat/service/nftchecker/NFTPreviewService.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ export class NFTPreviewService {
4242
forceFlush?: boolean;
4343
}): Promise<NFTInfoType> {
4444
const address = formatToBase32(contractAddress) as string;
45-
let token = await Token.findOne({attributes: ['hex40id', 'type', 'ipfsGateway'], where: {base32: address}});
46-
if (!token) {
47-
token = await TokenQuery.detectTokenType({base32: address}) as Token;
48-
}
45+
const token = await Token.findOne({attributes: ['hex40id', 'type', 'ipfsGateway'], where: {base32: address}});
46+
const typeInfo = await TokenQuery.detectTokenType({base32: address}) as Token;
47+
token.type = typeInfo.type; // support hybrid nft
4948
if (token.type !== CONST.TRANSFER_TYPE.ERC1155 && token.type !== CONST.TRANSFER_TYPE.ERC721) {
5049
throw new Errors.ParameterError(`The contract ${contractAddress} not a NFT contract`);
5150
}

0 commit comments

Comments
 (0)