Skip to content

Gates

Gates are reusable bundles of conditions that restrict who can mint from a sale. A gate is owned by an account; attach a gate to a sale by setting accessMode: "GATED" and gateId when creating the sale.

For the full access-controlled sale flow, see gated sales.

const res = await client.gate.list();

Lists gates owned by the authenticated account.

const res = await client.gate.get({ gateId });
const res = await client.gate.create({
name: "Holder Gate",
matchMode: "ALL", // "ALL" (AND) | "ANY" (OR); default "ALL"
conditions: [
{
type: "TOKEN_OWNERSHIP",
config: {
contractAddress: "0x...",
chainId: 8453,
minAmount: 1, // optional, defaults to 1
},
},
],
});

Replaces the entire gate. Partial updates are not supported for conditions:

await client.gate.update({
gateId,
name: "Renamed",
matchMode: "ANY",
conditions: [ /* full replacement */ ],
});
await client.gate.remove({ gateId });

Gates referenced by a live sale cannot be deleted.

Every condition has type and config. On-chain conditions require a chainId.

{
type: "ALLOWLIST",
config: {
addresses: ["0x1111...", "0x2222..."],
},
}
{
type: "TOKEN_OWNERSHIP",
config: {
contractAddress: "0x...",
chainId: 8453,
minAmount: 1, // optional
},
}
{
type: "SPECIFIC_TOKEN",
config: {
contractAddress: "0x...",
chainId: 8453,
tokenId: "42", // string
},
}
{
type: "TOKEN_ATTRIBUTE",
config: {
contractAddress: "0x...",
chainId: 8453,
traitType: "Background",
traitValue: "Gold",
},
}
{
type: "CURRENCY_BALANCE",
config: {
chainId: 8453,
contractAddress: "0x...", // optional — omit for native currency
minBalance: "0.1", // decimal string of the currency's major unit
},
}
{
type: "FARCASTER_FOLLOW",
config: {
fid: 12345,
},
}
  • RANKED_AUCTION + GATED is rejected at sale validation.
  • Gate condition checks run at claim time, not gate-creation time — token-ownership conditions can fail later if the caller transfers out.
  • Gates can be reused across many sales.