Mobile Minting unlocks mobile payments for onchain purchases and powers minting in the Rally app (formerly known as Floor!).
π± Users pay in-app with In-App Purchases
βοΈ A fleet of signers instantly deliver NFTs onchain
For users: no π Bridging, no β½οΈ Gas fees - just the tap of a button!
Example Mobile Minting user experience.
This repository is a public, contributable collection of Ingestors that teach Mobile Minting how to support mints from new platforms.
Historically, only Rally could choose what mints users could mint through Rally based on our roadmap, or partnerships, now anyone can build support for any minting platform / product and (provided it meets some safety & reliability checks) it can be included in Mobile Minting.
This library is included in Rally's platform and executed in a sandboxed environment for indexing mints.
Today, Mobile Minting supports the following creator platforms:
Platform | Chains | Create from URL | Create from onchain address | Supports Quantity |
Zora | Base, Zora | β | β | β |
Highlight | Base | π₯ Failing | π₯ Failing | π₯ Failing |
Rodeo | Base | β | β | β |
Manifold | Base | β | β | β |
FXHash | Base | β | β | β |
Rarible | Base | β | β | β |
Foundation | Base, ETH | β | β | β |
Transient Labs | Base | β | β | β |
Adding a new platform to Mobile Minting is easy - you just have to write a MintIngestor
!
A MintIngestor has a simple job:
Transform a URL or contract address into a valid MintTemplate, iff it represents a supported mint by the ingestor
A MintTemplate is a standard format for expressing the details of a mint. It's used to populate the marketing page, pricing, and ultimately fulfill the item onchain.
Mapping of MintTemplate fields to an in-app mint.
Once you generate a MintTemplate, Rally will do all the additional work to get the mint live:
- Map priceWei to an in-app purchase
- Simulate the transaction in multiple scenarios to ensure success
- Re-host all images & cache IPFS resources
The full process looks something like this...
We recommend consulting example complete ingestor PRs e.g. #65: VV Mint Ingestor.
You will create a new folder in src/ingestors
for your new Ingestor.
export class MyMintIngestor implements MintIngestor {
async supportsUrl(resources: MintIngestorResources, url: string): Promise<boolean> {
// check if URL is supported by your ingestor
}
async supportsContract(resources: MintIngestorResources, contract: MintContractOptions): Promise<boolean> {
// check if the contract is supported by the ingestor
}
async createMintTemplateForUrl(resources: MintIngestorResources, url: string): Promise<MintTemplate> {
// create the mint template for your URL
}
async createMintForContract(resources: MintIngestorResources, contract: MintContractOptions): Promise<MintTemplate> {
// create the mint template for your contract
}
}
For building the MintTemplate, we recommend using the MintTemplateBuilder
which will ensure validation and give handy builder methods.
In this example we make a template, relying on getMintMetadataFromSomewhere()
and getMintContractDetailsFromSomewhere()
to fetch the marketing & onchain data respectively. We'll touch on those later.
const mintBuilder = new MintTemplateBuilder()
.setOriginalUrl(url)
.setMintInstructionType(MintInstructionType.EVM_MINT)
.setPartnerName('MyMints');
const { name, description, image } = await getMintMetadataFromSomewhere();
mintBuilder.setName(name).setDescription(description).setFeaturedImageUrl(image);
const { contractAddress, priceWei } = await getMintContractDetailsFromSomewhere();
mintBuilder.setMintInstructions({
chainId: '8453',
contractAddress,
contractMethod: 'mint',
contractParams: '[address, 1]',
abi: YOUR_ABI_FILE_IMPORT,
priceWei: totalPriceWei,
});
Note: You will typically want to implement either createMintForContract
or createMintTemplateForUrl
, and then call that one from the other.
You can then build the MintTemplate from the builder.
return mintBuilder.build();
Note that mintBuilder.build()
will throw if the MintTemplate does not meet validation requirements.
Your MintIngestor is passed a resources
object in it's sandboxed environment.
async createMintTemplateForUrl(url: string, resources: MintIngestorResources): Promise<MintTemplate>
This resources object contains properties:
alchemy
: An initalized Alchemy instancefetch
: An HTTP client (Axios)
You can use these to fetch resources you need.
Note: You will need to set up a locally Alchemy key for testing, and YOU MUST NOT attempt to import resources not passed in the resources object
In order to use the Alchemy instance on resources, you will need to set a local Alchemy key.
- Copy
.env.sample
->.env
- Insert your own Alchemy API key as
ALCHEMY_API_KEY
This repo uses Yarn to manage dependencies & execution.
When you pull the repository, setup can be completed (and confirmed) using:
yarn
yarn test
You can try your mint ingestory using yarn dry-run
-- this will:
- Create an instance of your minter
- Pass the inputs you provide to it
- Print out the output MintTemplate
yarn dry-run <minterSlug> <inputType> <input>
<minterSlug>
: The key for the ingestor in ALL_MINT_INGESTORS
<inputType>
: url
or contract
<input>
: A full URL for url
, or a colon delimited fullly qualified address for `contract
Examples:
yarn dry-run prohibition-daily url https://daily.prohibition.art/mint/8453/0x896037d93a231273070dd5f5c9a72aba9a3fe920
yarn dry-run prohibition-daily contract 8453:0x896037d93a231273070dd5f5c9a72aba9a3fe920
yarn dry-run some-erc-1155-ingestor contract 8453:contractAddress:tokenId
Once you've written a Mobile Minting Ingestor, it needs to be Pull Requested to this repository to be included in the production Rally Mobile Minting ingestion fleet.
- Ensure your generated MintTemplate works π
- Ensure that your code is restricted to a single folder in
src/ingestors
- Ensure that all required assets are included (e.g. ABIs)
- Ensure ABIs are trimmed to include only methods (1) used in the ingestor or (2) required to mint
- Ensure that all exported methods are prefixed with the name of your ingestor e.g.
myMintingPlatformGetContractDetails
- Ensure that a test exists for generating a MintTemplate that will always succeed
- Ensure that your code accesses no external resources except those passed in the
resources
object
Open a Pull Request against this repo with your new Ingestor, as well as any comments / questions.
We're excited to see new platforms supported, so will quickly jump to help!
Mobile Minting started out entirely internal & this is our first experiment in decentralizing it & making it more accessible.
In time, we hope to continue down this path, but for now all ingestors will be reviewed by the Rally engineering team & accepted on the basis of safety, cost & other considerations by Rally.
We hope to see people (other companies!?) emerge for whom Mobile Minting, and a unified standard for expressing onchain mints is useful, and look forward to working with them to continue this mission.
Open an issue, or email [email protected]