Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

API Reference

Complete API documentation for the Gatekeeper SDK.

The SDK is organized into two main categories:

  • Writes - Transaction preparation utilities for state-changing operations (viem-based)
  • Reads - Query methods for indexed blockchain data (Ponder/Drizzle-based)

Writes

Transaction preparation utilities for deploying contracts, managing sales, and executing purchases.

Factory

Deploy Gatekeeper1155 contracts via the factory pattern.

  • prepareDeploy() - Prepare a deployment transaction
  • generateSalt() - Generate CREATE2 salt
  • predictAddress() - Predict deployment address
  • encodeGrantRoles() - Encode role grants
  • encodeSetupNewTier() - Encode tier creation
  • encodeCallGatekeeper() - Encode Gatekeeper calls

Gatekeeper

Manage sales and execute purchases.

  • encodeRegisterSale() - Register a new sale
  • encodeUpdateSale() - Update sale configuration
  • preparePurchase() - Prepare purchase transaction
  • preparePurchaseWithApproval() - Prepare approval-gated purchase
  • prepareWithdraw() - Withdraw funds
  • prepareGetPrice() - Get price breakdown
  • prepareGetSale() - Get sale state

Gatekeeper1155

Token operations and role management on deployed contracts.

  • prepareSetupNewTier() - Create a new ticket tier
  • prepareAdminMint() - Mint tickets
  • prepareAdminStubTickets() - Check in attendees
  • prepareVoidTickets() - Void tickets
  • prepareGrantRoles() / prepareRevokeRoles() - Manage roles

Signing

EIP-712 utilities for approvals and ticket intent signatures.

Approval

Typed data for purchase approvals.

  • getTypedData() - Generate typed data for signing
  • getDeadline() - Calculate deadline timestamp
  • types - EIP-712 type definitions
  • domain - EIP-712 domain separator

TicketIntent

Typed data for proving ticket ownership.

  • types - EIP-712 type definitions
  • domain - EIP-712 domain separator
  • primaryType - Primary type identifier
  • messageSchema - Zod schema for validation

Reads

Query indexed blockchain data via Ponder. All read operations require a configured client.

Client

Create and configure the query client.

  • Client.create() - Create a client instance
  • client.db - Raw Drizzle query builder
  • client.live() - Subscribe to live updates via SSE
  • client.getStatus() - Get indexer status
  • client.schema - Access Ponder schema tables

EventContract

Query deployed Gatekeeper1155 contracts.

  • get() - Get a contract by address
  • list() - List contracts with filters
  • listByCreator() - List contracts by creator
  • listByOwner() - List contracts by owner

Sale

Query sale configurations.

  • get() - Get a sale by ID
  • getByKey() - Get a sale by composite key
  • listByContract() - List sales for a contract
  • listByVendor() - List sales by vendor
  • listActive() - List currently active sales

Tier

Query ticket tier configurations with supply statistics.

  • get() - Get a tier by token ID
  • getWithSupply() - Get tier with supply info
  • getStats() - Get attendance statistics
  • listByContract() - List tiers for a contract
  • listByContractWithSupply() - List tiers with supply data

Token

Query ERC1155 token data.

  • get() - Get a token by ID
  • listByContract() - List tokens for a contract

Balance

Query token holder balances with ticket/stub status.

  • get() - Get a specific balance
  • getTokenStatus() - Get holder's token/stub status
  • getHoldings() - Get all holdings for an address
  • isStubbed() - Check if holder has stubs
  • listByToken() - List holders of a token
  • listByHolder() - List balances for a holder
  • hasBalance() - Check if holder has balance

Transfer

Query transfer history including mints and burns.

  • listByToken() - List transfers for a token
  • listByFrom() - List transfers from an address
  • listByTo() - List transfers to an address
  • listMints() - List mint events
  • listBurns() - List burn events

Permission

Query user permissions and role grants.

  • get() - Get permission for a user
  • hasRole() - Check if user has a role
  • listByContract() - List permissions for a contract
  • listByUser() - List permissions for a user
  • listByRole() - List users with a specific role
  • Utilities: decodeRoles(), hasRoleInMask(), combineRoles()

Stub

Query stubbing events (check-ins where tickets become stubs).

  • listByContract() - List stubs for a contract
  • listByHolder() - List stubs for a holder
  • listByTier() - List stubs for a tier

Void

Query voiding events (burns without stub conversion).

  • listByContract() - List voids for a contract
  • listByHolder() - List voids for a holder
  • listByTier() - List voids for a tier

Utilities

Errors

Custom error types for SDK operations.

Validators

Input validation utilities.


Exported Constants

Contract Addresses

import {
  gatekeeperAddress,
  gatekeeper1155Address,
  gatekeeper1155FactoryAddress,
} from '@sceneinfrastructure/sdk'

Role Constants

import {
  ADMIN_ROLE,
  HOST_ROLE,
  DOOR_ROLE,
  MINTER_ROLE,
} from '@sceneinfrastructure/sdk'

ABIs

import {
  gatekeeperAbi,
  gatekeeper1155Abi,
  gatekeeper1155FactoryAbi,
} from '@sceneinfrastructure/sdk'

Protocol Fee

import { PROTOCOL_FEE_BPS } from '@sceneinfrastructure/sdk'
// 100 = 1%