Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #257 from tqtezos/v0.4.2
Browse files Browse the repository at this point in the history
V0.4.2
  • Loading branch information
lambdahands committed Mar 17, 2021
2 parents d5dec9b + 8431088 commit 7ff83aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![OpenMinter header](/docs/assets/minterhead.png)

[![](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE) [![](https://img.shields.io/badge/version-v0.4.1-orange)](https://github.com/tqtezos/minter)
[![](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE) [![](https://img.shields.io/badge/version-v0.4.2-orange)](https://github.com/tqtezos/minter)

## OpenMinter

Expand Down
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 7ff83aa

Please sign in to comment.