Skip to content

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 });
TypeWhat it does
DISCRETE_DUTCH_AUCTIONStep-based Dutch auction with scheduled prices
RANKED_AUCTIONSealed-bid auction with optional rebate
SEED_BASED_MINTStandard minting with seed-based token assignment
GASLESSGas-sponsored minting via meta-transactions
CUSTOMUser-registered custom mechanic

The first four are seeded and immutable. You cannot create, update, or delete them.

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.

await client.mechanic.update({
mechanicId,
name: "Renamed",
description: "...",
configSchema: { /* ... */ },
});

Built-in mechanics can’t be updated. slug is immutable.

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,
});

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.