Tutorials
Technical Guides
Featured Guides
Developing Your Application for the Dapper Platform
Welcome to the development journey on the Dapper Platform, where your application will reach our ever-growing user base. You can think of this process as similar to publishing an application to an app store, reaching eager end-users in the ecosystem. This section will walk you through the journey of getting your application configured in the Testnet environment.
Prerequisites
Before proceeding, you will need the following:
Upload Your Contract to Flow NFT Catalog
FLOW NFT Catalog is an on-chain catalog of NFTs in the Flow ecosystem, meant to provide discoverability and interoperability. It does so by enforcing the implementation of the NonFungibleToken interface and the metadata-views. Adding your contract here will enable other developers and users to discover and query your NFT on the collection level.
Prepare Your Contract
Make sure your smart contract meets the following criteria:
- It implements the NonFunigbleToken interfaces in the Flow NonFungibleToken Contract. Refer to the Example NFT for example implementation on how to set up collection, minter, and more.
- It implements the MetadataView.Resolver interface. Refer to the Example NFT for example implementation on MetadataViews.
- The smart contract itself should avoid dealing with any fungible token. Transactions are to be used when dealing with fungible tokens and other currencies.
Upload Your contract to Flow NFT Catalog
To submit to the catalog, follow the Submitting a Collection to the NFT Catalog steps. It typically takes a couple of days for your contract to get approved. You can check out the status of the proposal here.
While waiting for approval, you may jump to the next step and create a new entry for your app in the Developers Portal.
Create a New App in the Developer Portal
Creating a New App
Login to your developers portal dashboard home page. Click the plus button next to “Manage Apps”
After entering your app name, you will be taken to the Manage App page to set up the configurations.
Configure Application Details
The Dapper Platform will display your application details and branding for various use-cases. In order to do that, we need details on your application. On the Manage App page, you will be asked to provide the following information:
- Primary website link
- Description
- Supported domains
- Upload logos
- To best ensure visibility on the inventory page, the background should be transparent, image cropped to the edges of the text.
- Image size limited to 100KB
- Upload banner
- Customer support link
- Twitter profile (optional)
- Discord link (optional)
URL of the primary website where your NFTs will be listed for purchase. It will be used by Dapper to market your NFT.
A short description that highlights the nature of your app, with a 200-character limit.
Additional URL’s where you will be requesting users to sign transactions related to this NFT.
The uploaded logos will be used for branding purposes throughout the platform, including the user’s inventory page.
This banner image will show up on your user login/sign-up modal. The image should be less than 450px in width and less than 1M in size.
Users will be directed to this URL when clicking on the “Contact Support” link on the NFT receipt.
Your NFT Twitter profile URL
Your NFT discord channel URL
Configure NFT Inventory
In order for the Dapper Platform to be aware of your NFTs and be able to display them in the end-user’s wallet, you must register your contract. Click on the “Add a new NFT Contract” button in the “NFT inventory configuration” section. Fill in the form to register your NFT contract against Dapper.
- NFT Contract Name
- Display Name
- NFT collection public path
- NFT collection storage path
The unique identifier of your contract follows the format of A.[account].[identifier]
.
When there are multiple contracts, this field is used to allow users to select which collection type to display in the view of a single collection.
The public path you defined in your contract.
The storage path you defined in your contract.
Next Step
Now that you’ve configured your app, the next step would be creating the transactions using Cadence. You can either write customized transactions, or leverage Flow NFT Catalog to generate some of the most common transactions with the next step, Generate and Upload Transactions and Scripts.
Generate and Upload Transactions and Scripts
One of Dapper Platform’s values is trust for the end-user. To ensure that, transactions that your application will invoke must be pre-registered with the platform and reviewed. In the staging environment, custom transactions are automatically approved, whereas developer-generated purchase transactions (exchange of funds) need to be submitted for review.
An alternative way to generate transactions is by copying the transactions generated by the NFT catalog. It is able to do so because the catalog enforces your NFT contract to follow the NonFungibleToken as well as the MetadataViews standards, allowing for further inter-operability using the NFT Storefront contract mentioned below. This document will walk you through the process of using transactions generated from the NFT Catalog.
Understand NFT Storefront
Dapper and the NFT Catalog leverage the NFT Storefront contract to provide the capabilities of listing and purchasing of NFTs. It provides a secure way to trade any NFT with any type of currency and fungible tokens. You can think of it as a vending machine for a given account.
- The action of “loading” the vending machine with NFT items an account owns is called
listing
. - The action of locating a listed NFT item and acquiring the item is called
purchasing
.
To learn more about the specifics of how the NFT Storefront works, please visit its Flow documentation page. This is completely optional.
Generate Required Transactions and Scripts
Once your contract has been approved, you can go to the Flow NFT Catalog Generate Transactions (Testnet) page:
- Enter the unique collection identifier that was registered for your application.
- Switch the token type with the Fungible Token dropdown (it’s only relevant to the purchase and listing transactions)
- Clicking on the items on the left menu bar to generate transactions and scripts.
Here’s the list of transactions and scripts that can be generated to meet the basic sales need of your NFT:
Transactions:
Depending on your application’s use case, you may need up to 7 transactions. Here are the different types:
- CollectionInitialization
- DapperCreateListing
- StorefrontRemoveItem
- DapperBuyNFTDirect (x2)
- DapperBuyNFTMarketplace (x2)
This transaction initializes your NFT collection for a user. It creates an empty collection and stores it in the user’s storage path so that the user can own your NFT.
Both your organization and your users can use this transaction to list an NFT item for sale. This transaction adds a Storefront resource to the caller’s account, prepares the NFT item for sale, and creates a Storefront listing.
Once successfully executed, it will return a listingResourceID
, which is used to identify the NFT item listing in a purchase transaction.
This transaction facilitates the removal of a listing.
This a purchase transaction, this transaction allows your user to purchase NFT from your organization directly.
This is a purchase transaction, this transaction allows your user to purchase your NFT from another wallet who has listed the NFT for sale (p2p marketplace).
Scripts
- DapperGetPrimaryListingMetadata
- DapperGetSecondaryListingMetadata
This script returns information about a Storefront listing that is listed for the first time by your organization. This script is leveraged by Dapper Platform UI during the purchase flow. This is needed as a part of the DapperBuyNFTDirect transaction, for both FUT and DUC. The same script can be used.
This script returns information about a Storefront listing that is listed on the secondary marketplaces. This script is leveraged by Dapper Platform UI during the purchase flow. This is needed as a part of the DapperBuyNFTMarketplace transaction, for both FUT and DUC. The same script can be used.
Copy these transactions into your code and make sure to invoke them verbatim.
Upload Transactions and Submit for Review
To register them in the Dapper Platform, go to the developers portal dashboard and click on the app you created, you will land on the Manage app page. Scroll down to the “Transactions” section and click “Add new transaction”.
- Title
- Description
- Transaction type
- Purchase: Purchase transactions are the transactions your users sign to purchase an NFT item. This applies to both direct sales (DapperBuyNFTDirect) and p2p (DapperBuyNFTMarketplace) sales as mentioned in the catalog transaction section.
- Custom: Any transaction that is not a purchase transaction is categorized as custom transaction.
- Code
- Metadata script(when purchase transaction type selected)
A user-facing transaction name to help end-users to understand what this transaction does.
A short description describes to the reviewer what this transaction does
The cdc
files generated from last step.
For any purchase transaction, its metadata script allows Dapper to query the on-chain data about the transaction.
Step 1: Upload the direct sale transaction and script
- Add a new transaction
- Fill in the title and description, and enter something to indicate the fungible token this transaction uses (Dapper Utility Coin or Flow Utility Token)
- Select “Purchase” as the transaction type
- For “Code”, upload DapperBuyNFTDirect generated with Dapper Utility Coin
- For “Metadata Script”, paste the content of DapperGetPrimaryListingMetadata
- Repeat 1-5 with DapperBuyNFTDirect generated with Flow Utility Token using the same metadata script.
Step 2: Upload the p2p marketplace sale transaction and script
- Add a new transaction
- Fill in title and description, enter something to indicate the fungible token this transaction uses (Dapper Utility Coin or Flow Utility Token)
- Select “Purchase” as transaction type
- For “Code”, upload DapperBuyNFTMarketplace
- For “Metadata Script”, paste the content of DapperGetSecondaryListingMetadata
- Repeat 1-5 with DapperBuyNFTMarketplace generated with Flow Utility Token using the same metadata script.
Step 3: Upload the custom transactions
For CollectionInitialization, DapperCreateListing and StorefrontRemoveItem, choose “Custom” as the transaction type and upload the cdc files. Custom transactions are automatically approved.
What’s next
With the exception of custom transactions in Staging, all transactions require a review by Dapper solution engineers in order for them to be whitelisted and invokable. After uploading, reach out to your account manager for review which will take up to 2 days. You can view the approval status on the Developer Portal. It will show one of the three statuses:
- Live
- In review
- Rejected
This means your transaction is whitelisted and ready to be used in your app.
This means your transaction is still in review.
This means your transaction is rejected due to security issues, reach out to your account manager for further assistance.
Testing Your Application
With the app details filled, contract registered, transactions uploaded and reviewed, you are now ready for testing! Just to be safe, here is a checklist of the common things to test for.
App Submission for Review
The final step of Testnet journey is to submit your application for review. Upon a successful review, you would be granted to develop on Dapper Platform for Mainnet, where Dapper end-users can’t wait to see what you have to offer.
Happy Developing!
ON THIS PAGE
- Developing Your Application for the Dapper Platform
- Prerequisites
- Upload Your Contract to Flow NFT Catalog
- Prepare Your Contract
- Upload Your contract to Flow NFT Catalog
- Create a New App in the Developer Portal
- Creating a New App
- Configure Application Details
- Configure NFT Inventory
- Next Step
- Generate and Upload Transactions and Scripts
- Understand NFT Storefront
- Generate Required Transactions and Scripts
- Transactions:
- Scripts
- Upload Transactions and Submit for Review
- Step 1: Upload the direct sale transaction and script
- Step 2: Upload the p2p marketplace sale transaction and script
- Step 3: Upload the custom transactions
- What’s next
- Testing Your Application
- App Submission for Review