On this page
1 min read
We exposed an interface to the catalog via a consumable NPM module. This library will expose a number of methods that can be called to interact with the catalog.
Method signatures and their associating parameters/responses can be found in the cadence/
folder of this repo.
1checkForRecommendedV1Views2genTx3getAllNftsInAccount4getExamplenftCollectionLength5getExamplenftType6getNftCatalog7getNftCatalogProposals8getNftCollectionsForNftType9getNftIdsInAccount10getNftInAccount11getNftInAccountFromPath12getNftMetadataForCollectionIdentifier13getNftProposalForId14getNftsCountInAccount15getNftsInAccount16getNftsInAccountFromIds17getNftsInAccountFromPath18getSupportedGeneratedTransactions19hasAdminProxy20isCatalogAdmin
1addToNftCatalog2addToNftCatalogAdmin3approveNftCatalogProposal4mintExampleNft5mintNonstandardNft6proposeNftToCatalog7rejectNftCatalogProposal8removeFromNftCatalog9removeNftCatalogProposal10sendAdminCapabilityToProxy11setupExamplenftCollection12setupNftCatalogAdminProxy13setupNonstandardnftCollection14setupStorefront15transferExamplenft16updateNftCatalogEntry17withdrawNftProposalFromCatalog
1npm install flow-catalog
or
1yarn add flow-catalog
Methods can be imported as follows, all nested methods live under the scripts
or transactions
variable.
NOTE: In order to properly bootstrap the method, you will need to run and await
on the getAddressMaps()
method, passing it into all of the methods as shown below.
1import { getAddressMaps, scripts } from "flow-catalog";23const main = async () => {4const addressMap = await getAddressMaps();5console.log(await scripts.getNftCatalog(addressMap));6};78main();
The response of any method is a tuple-array, with the first element being the result, and the second being the error (if applicable).
For example, the result of the method above would look like -
1[2{3BILPlayerCollection: {4contractName: 'Player',5contractAddress: '0x9e6cdb88e34fa1f3',6nftType: [Object],7collectionData: [Object],8collectionDisplay: [Object]9},10...11SoulMadeComponent: {12contractName: 'SoulMadeComponent',13contractAddress: '0x421c19b7dc122357',14nftType: [Object],15collectionData: [Object],16collectionDisplay: [Object]17}18},19null20]