GetNftCatalog (maybe also other functions) return only testnet nfts
Opened this issue ยท 1 comments
PeterBenc commented
Thanks for developing the lib ๐
Issue:
- no matter what I do, I get only testnet collections
Possible cause:
- https://github.com/dapperlabs/nft-catalog/blob/11c950f97512a46d5dc8df5fcd1be3a0da1fca68/index.js#L24
- the function has the side effect of setting the environment (mainnet then testnet) which then never gets reset, so it stays testnet (getNftCatalog function then just reads this environment which is always testnet)
Solution:
- IMO it's pretty strange that
getAddressMaps
returns costs for both mainnet and testnet, it should at least receive an argumentmainnet | testnet
and return only network-specific address maps.
prpatel05 commented
This is a fair callout. A quick workaround would be to import @onflow/flow-cadut
and set the environment correctly to the network you want. We will think through how to better approach this problem.
Ideally, taking in a network parameter would be useful here, however, alot of this code/functions are auto-generated.