Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:tqtezos/minter into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mycodecrafting committed Mar 17, 2021
2 parents eb8b15e + b40e9c5 commit c2806b7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/lib/nfts/queries.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Buffer } from 'buffer';
import Joi from 'joi';
import { SystemWithToolkit, SystemWithWallet } from '../system';
import { hash as nftAssetHash } from './code/fa2_tzip16_compat_multi_nft_asset';
import select from '../util/selectObjectByKeys';
import { ipfsUriToCid } from '../util/ipfs';

Expand Down Expand Up @@ -136,7 +135,7 @@ export async function getNftAssetContract(

const metaBigMap = await system.betterCallDev.getBigMapKeys(metadataBigMapId);
const metaUri = select(metaBigMap, { key_string: '' })?.value.value;
const { metadata } = await system.resolveMetadata(metaUri);
const { metadata } = await system.resolveMetadata(fromHexString(metaUri));

const { error } = metadataSchema.validate(metadata, { allowUnknown: true });
if (error) {
Expand All @@ -149,7 +148,13 @@ export async function getWalletNftAssetContracts(system: SystemWithWallet) {
const bcd = system.betterCallDev;
const response = await bcd.getWalletContracts(system.tzPublicKey);
const assetContracts = response.items.filter(
(i: any) => i.body.hash === nftAssetHash
(i: any) => Object.keys(i.body).includes("tags") &&
i.body.tags.includes("fa2") &&
Object.keys(i.body).includes("entrypoints") &&
i.body.entrypoints.includes("balance_of") &&
i.body.entrypoints.includes("mint") &&
i.body.entrypoints.includes("transfer") &&
i.body.entrypoints.includes("update_operators")
);

const results = [];
Expand Down

0 comments on commit c2806b7

Please sign in to comment.