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 transactiongenerateSalt()- Generate CREATE2 saltpredictAddress()- Predict deployment addressencodeGrantRoles()- Encode role grantsencodeSetupNewTier()- Encode tier creationencodeCallGatekeeper()- Encode Gatekeeper calls
Gatekeeper
Manage sales and execute purchases.
encodeRegisterSale()- Register a new saleencodeUpdateSale()- Update sale configurationpreparePurchase()- Prepare purchase transactionpreparePurchaseWithApproval()- Prepare approval-gated purchaseprepareWithdraw()- Withdraw fundsprepareGetPrice()- Get price breakdownprepareGetSale()- Get sale state
Gatekeeper1155
Token operations and role management on deployed contracts.
prepareSetupNewTier()- Create a new ticket tierprepareAdminMint()- Mint ticketsprepareAdminStubTickets()- Check in attendeesprepareVoidTickets()- Void ticketsprepareGrantRoles()/prepareRevokeRoles()- Manage roles
Signing
EIP-712 utilities for approvals and ticket intent signatures.
Approval
Typed data for purchase approvals.
getTypedData()- Generate typed data for signinggetDeadline()- Calculate deadline timestamptypes- EIP-712 type definitionsdomain- EIP-712 domain separator
TicketIntent
Typed data for proving ticket ownership.
types- EIP-712 type definitionsdomain- EIP-712 domain separatorprimaryType- Primary type identifiermessageSchema- 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 instanceclient.db- Raw Drizzle query builderclient.live()- Subscribe to live updates via SSEclient.getStatus()- Get indexer statusclient.schema- Access Ponder schema tables
EventContract
Query deployed Gatekeeper1155 contracts.
get()- Get a contract by addresslist()- List contracts with filterslistByCreator()- List contracts by creatorlistByOwner()- List contracts by owner
Sale
Query sale configurations.
get()- Get a sale by IDgetByKey()- Get a sale by composite keylistByContract()- List sales for a contractlistByVendor()- List sales by vendorlistActive()- List currently active sales
Tier
Query ticket tier configurations with supply statistics.
get()- Get a tier by token IDgetWithSupply()- Get tier with supply infogetStats()- Get attendance statisticslistByContract()- List tiers for a contractlistByContractWithSupply()- List tiers with supply data
Token
Query ERC1155 token data.
get()- Get a token by IDlistByContract()- List tokens for a contract
Balance
Query token holder balances with ticket/stub status.
get()- Get a specific balancegetTokenStatus()- Get holder's token/stub statusgetHoldings()- Get all holdings for an addressisStubbed()- Check if holder has stubslistByToken()- List holders of a tokenlistByHolder()- List balances for a holderhasBalance()- Check if holder has balance
Transfer
Query transfer history including mints and burns.
listByToken()- List transfers for a tokenlistByFrom()- List transfers from an addresslistByTo()- List transfers to an addresslistMints()- List mint eventslistBurns()- List burn events
Permission
Query user permissions and role grants.
get()- Get permission for a userhasRole()- Check if user has a rolelistByContract()- List permissions for a contractlistByUser()- List permissions for a userlistByRole()- 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 contractlistByHolder()- List stubs for a holderlistByTier()- List stubs for a tier
Void
Query voiding events (burns without stub conversion).
listByContract()- List voids for a contractlistByHolder()- List voids for a holderlistByTier()- 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%