DogecoinArcade
@ Create a new account

Mintpads: designing your own

docs/mintpads.md

Jump to: How a mintpad works · 1. Set up the sale · 2. Build the page · 3. Inscribe it as a mintpad · Good to know

A mintpad is a page that sells a collection or a token to whoever opens it: press the button, confirm, and a random piece of the collection (or a lot of the token) is yours. The Launchpad wizard (Creator → Launchpad wizard) makes one from a set of ready-made looks. This guide is for building your own page instead: any design, any animation, anything a page can do, selling through the same wallet machinery.

How a mintpad works

A mintpad is two things, and only one of them is the page.

What makes a page a mintpad is the JSON inscribed beside it. The Exchange's Mintpads tab lists every page whose JSON says it is a pad for its own creator's collection or token, as long as there is something left to mint. If you inscribe a new pad for the same collection or token, it replaces the old one in that list.

1. Set up the sale

A collection: run the Launchpad wizard for it once, with your price. The price is in coins, or in any token: fill in Paid in with the token's number (19 for PLASMA) and the price is that many of it. The piece and the token then move in one transaction, or neither does. It signs your pieces over, puts the sales on the chain and inscribes a standard page. Your own page, inscribed afterwards, replaces the standard one on the Exchange, and both keep working.

A token: put a sell order on the Exchange (Exchange → Tokens → your token → Sell) for the whole amount you want to sell, at your price per token. No wizard needed. Each mint takes one lot from that order, and partial fills are automatic.

2. Build the page

Start from a working one: open any mintpad's page on its own at /content/<its id> and view its source. The standard pages are short, and everything below is visible in them.

A collection's pad

GET /r/mintpad/<creator>/<collection>

``json { "left": 12, "prices": [1000000], "price_texts": ["0.01 coins"], "next": { "listing": "…", "piece": "…", "number": 57, "edition": 12, "price": 1000000, "maker": "…" }, "listed": ["…", "…"] } ``

To mint, ask the wallet:

``js parent.postMessage({arcade: "mint", seq: 1, listing: next.listing, piece: next.piece, name: "My Collection #12"}, "*"); ``

A token's pad

GET /r/book/<property id>?address=<your address>

``json { "property_id": 19, "name": "PLASMA", "divisible": true, "asks": [ { "order": "…", "address": "…", "tokens": 100000000000, "coins": 1000000000, "pending": false, "taking": 0 } ] } ``

To mint a lot, ask the wallet to take it from the order:

``js parent.postMessage({arcade: "take", seq: 1, order: ask.order, units: LOT}, "*"); ``

The answers, for both

The wallet answers with messages carrying the same arcade and seq:

If no heard arrives within about four seconds, the page is not open inside the arcade: say "Open this mintpad on DogecoinArcade to mint from it."

A page shown in a post can ask for the room it needs: parent.postMessage({arcade: "size", height: 640}, "*").

What the person sees is the arcade's own confirmation card, outside your page: what they get, the price, the network fee. The purchase is one transaction their own browser checks and signs. Your page cannot change the price or press anything on their behalf.

3. Inscribe it as a mintpad

Inscribe your page from your own wallet, with Inscribe one thing on the NFTs page. Open JSON beside the file and enter one of these, with your own address as the creator (it is on Wallet → Coins):

A collection:

``json {"name": "Space Frogs mintpad", "mintpad": {"creator": "<your address>", "collection": "Space Frogs"}} ``

A token (lot in base units: 50 whole tokens of a divisible token is 5000000000):

``json {"name": "PLASMA mintpad", "tokenpad": {"creator": "<your address>", "property_id": 19, "lot": 5000000000}} ``

The creator has to be the address that inscribes the page, so nobody can make a pad that claims to sell your collection. Once the inscription is in a block, your page is on the Exchange under Mintpads.

Good to know

← all docs