Mechanics
A mechanic is the on-chain sale engine — e.g. the Dutch auction or ranked auction contract. Built-in mechanics are seeded by the platform; you can also register your own.
// All mechanics (built-in + custom for this account)const res = await client.mechanic.list();
// Filter to just custom mechanics (or just built-ins)const custom = await client.mechanic.list({ type: "CUSTOM" });No auth required.
const res = await client.mechanic.get({ mechanicId });Built-in types
Section titled “Built-in types”| Type | What it does |
|---|---|
DISCRETE_DUTCH_AUCTION | Step-based Dutch auction with scheduled prices |
RANKED_AUCTION | Sealed-bid auction with optional rebate |
SEED_BASED_MINT | Standard minting with seed-based token assignment |
GASLESS | Gas-sponsored minting via meta-transactions |
CUSTOM | User-registered custom mechanic |
The first four are seeded and immutable. You cannot create, update, or delete them.
Register a custom mechanic
Section titled “Register a custom mechanic”const res = await client.mechanic.create({ slug: "my-custom-mechanic", name: "My Custom Mechanic", description: "Description of the mechanic's behavior", configSchema: { /* JSON Schema for typeConfig validation */ }, encodingAbi: [ /* ABI for encoding on-chain calldata */ ],});Reference the returned mechanicId when creating CUSTOM sales.
Update
Section titled “Update”await client.mechanic.update({ mechanicId, name: "Renamed", description: "...", configSchema: { /* ... */ },});Built-in mechanics can’t be updated. slug is immutable.
Chain deployments
Section titled “Chain deployments”A mechanic needs at least one deployment per chain it’s usable on.
await client.mechanic.addDeployment({ mechanicId, chainId: 8453, address: "0xDeployedMechanicAddress",});Remove a deployment (the chainId goes in the body, not the URL):
await client.mechanic.removeDeployment({ mechanicId, chainId: 8453,});Using a mechanic in a sale
Section titled “Using a mechanic in a sale”For custom sales:
await client.collection.addSale({ // ... base fields ... type: "CUSTOM", mechanicId: "your-mechanic-uuid", typeConfig: { // validated against the mechanic's configSchema },});Built-in mechanics are wired automatically when you pick DUTCH_AUCTION or RANKED_AUCTION — you don’t set mechanicId for those.