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

Gatekeeper1155

Utilities for ERC1155 token operations on Gatekeeper1155 contracts.

import { Gatekeeper1155 } from '@sceneinfrastructure/sdk'

Token Operations

prepareSetupNewTier

Creates a new ticket tier with metadata and supply configuration. Requires admin permissions (see Role Management).

import { createWalletClient, http } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { base } from 'viem/chains'
import { Gatekeeper1155 } from '@sceneinfrastructure/sdk'
 
const account = privateKeyToAccount('0x...' as `0x${string}`)
const walletClient = createWalletClient({
  account,
  chain: base,
  transport: http(),
})
 
const { to, data } = Gatekeeper1155.prepareSetupNewTier({
  contract: '0x1234567890123456789012345678901234567890',
  tokenURI: 'ipfs://QmTokenMetadata...',
  stubURI: 'ipfs://QmStubMetadata...',
  maxSupply: 1000n, // 0n for unlimited
})
 
await walletClient.sendTransaction({ to, data })

Parameters

ParameterTypeDescription
contractAddressGatekeeper1155 contract address
tokenURIstringMetadata URI for the ticket tier
stubURIstringMetadata URI for stubbed (used) tickets
maxSupplybigintMaximum supply (0 for unlimited)
as'data' | 'args'Output format

prepareAdminMint

Mints tickets to a recipient. Requires minting permissions (see Role Management).

import { createWalletClient, http } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { base } from 'viem/chains'
import { Gatekeeper1155 } from '@sceneinfrastructure/sdk'
 
const account = privateKeyToAccount('0x...' as `0x${string}`)
const walletClient = createWalletClient({
  account,
  chain: base,
  transport: http(),
})
 
const { to, data } = Gatekeeper1155.prepareAdminMint({
  contract: '0x1234567890123456789012345678901234567890',
  recipient: '0x2345678901234567890123456789012345678901',
  tokenId: 1n,
  quantity: 2n,
})
 
await walletClient.sendTransaction({ to, data })

Parameters

ParameterTypeDescription
contractAddressGatekeeper1155 contract address
recipientAddressAddress to receive the tickets
tokenIdbigintToken tier ID
quantitybigintNumber of tickets to mint
dataHexOptional data to pass to receiver
as'data' | 'args'Output format

prepareAdminStubTickets

Checks in an attendee by converting their tickets to stubs. Requires check-in permissions (see Role Management).

import { createWalletClient, http } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { base } from 'viem/chains'
import { Gatekeeper1155 } from '@sceneinfrastructure/sdk'
 
const account = privateKeyToAccount('0x...' as `0x${string}`)
const walletClient = createWalletClient({
  account,
  chain: base,
  transport: http(),
})
 
const { to, data } = Gatekeeper1155.prepareAdminStubTickets({
  contract: '0x1234567890123456789012345678901234567890',
  attendee: '0x2345678901234567890123456789012345678901',
  tierId: 1n,
  amount: 1n,
})
 
await walletClient.sendTransaction({ to, data })

Parameters

ParameterTypeDescription
contractAddressGatekeeper1155 contract address
attendeeAddressAttendee address to check-in
tierIdbigintToken tier ID
amountbigintNumber of tickets to stub
as'data' | 'args'Output format

prepareVoidTickets

Burns tickets from an attendee. Requires void permissions (see Role Management).

import { createWalletClient, http } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { base } from 'viem/chains'
import { Gatekeeper1155 } from '@sceneinfrastructure/sdk'
 
const account = privateKeyToAccount('0x...' as `0x${string}`)
const walletClient = createWalletClient({
  account,
  chain: base,
  transport: http(),
})
 
const { to, data } = Gatekeeper1155.prepareVoidTickets({
  contract: '0x1234567890123456789012345678901234567890',
  attendee: '0x2345678901234567890123456789012345678901',
  tierId: 1n,
  amount: 1n,
})
 
await walletClient.sendTransaction({ to, data })

Parameters

ParameterTypeDescription
contractAddressGatekeeper1155 contract address
attendeeAddressAttendee address
tierIdbigintToken tier ID
amountbigintNumber of tickets to void
as'data' | 'args'Output format

prepareUpdateToken

Updates tier metadata. Requires admin permissions (see Role Management).

import { createWalletClient, http } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { base } from 'viem/chains'
import { Gatekeeper1155 } from '@sceneinfrastructure/sdk'
 
const account = privateKeyToAccount('0x...' as `0x${string}`)
const walletClient = createWalletClient({
  account,
  chain: base,
  transport: http(),
})
 
const { to, data } = Gatekeeper1155.prepareUpdateToken({
  contract: '0x1234567890123456789012345678901234567890',
  tokenId: 1n,
  uri: 'ipfs://new-metadata-uri',
  maxSupply: 500n,
})
 
await walletClient.sendTransaction({ to, data })

Parameters

ParameterTypeDescription
contractAddressGatekeeper1155 contract address
tokenIdbigintToken tier ID to update
uristringNew metadata URI
maxSupplybigintNew max supply (0 for unlimited)
as'data' | 'args'Output format

Role Management

prepareGrantRoles

Grants roles to an address. Requires admin permissions (see Role Management).

import { Gatekeeper1155, MINTER_ROLE, DOOR_ROLE } from '@sceneinfrastructure/sdk'
 
// Grant single role
const { to, data } = Gatekeeper1155.prepareGrantRoles({
  contract: '0x1234567890123456789012345678901234567890',
  user: '0x2345678901234567890123456789012345678901',
  roles: MINTER_ROLE,
})
 
// Grant multiple roles with bitwise OR
const { to: to2, data: data2 } = Gatekeeper1155.prepareGrantRoles({
  contract: '0x1234567890123456789012345678901234567890',
  user: '0x2345678901234567890123456789012345678901',
  roles: MINTER_ROLE | DOOR_ROLE,
})

Parameters

ParameterTypeDescription
contractAddressGatekeeper1155 contract address
userAddressAddress to grant roles to
rolesbigintRole bitmask (combine with |)
as'data' | 'args'Output format

prepareRevokeRoles

Revokes roles from an address. Requires admin permissions (see Role Management).

import { Gatekeeper1155, MINTER_ROLE } from '@sceneinfrastructure/sdk'
 
const { to, data } = Gatekeeper1155.prepareRevokeRoles({
  contract: '0x1234567890123456789012345678901234567890',
  user: '0x2345678901234567890123456789012345678901',
  roles: MINTER_ROLE,
})

Parameters

ParameterTypeDescription
contractAddressGatekeeper1155 contract address
userAddressAddress to revoke roles from
rolesbigintRole bitmask to revoke
as'data' | 'args'Output format

View Functions

prepareContractURI

Gets the contract-level metadata URI.

import { Gatekeeper1155, gatekeeper1155Abi } from '@sceneinfrastructure/sdk'
import { createPublicClient, http } from 'viem'
import { base } from 'viem/chains'
 
const publicClient = createPublicClient({
  chain: base,
  transport: http(),
})
 
const { to, functionName, args } = Gatekeeper1155.prepareContractURI({
  contract: '0x1234567890123456789012345678901234567890',
  as: 'args',
})
 
const uri = await publicClient.readContract({
  address: to,
  abi: gatekeeper1155Abi,
  functionName,
  args,
})

prepareGetTierInfo

Gets tier metadata including URI, max supply, and total minted.

import { Gatekeeper1155, gatekeeper1155Abi } from '@sceneinfrastructure/sdk'
import { createPublicClient, http } from 'viem'
import { base } from 'viem/chains'
 
const publicClient = createPublicClient({
  chain: base,
  transport: http(),
})
 
const { to, functionName, args } = Gatekeeper1155.prepareGetTierInfo({
  contract: '0x1234567890123456789012345678901234567890',
  tokenId: 1n,
  as: 'args',
})
 
const result = await publicClient.readContract({
  address: to,
  abi: gatekeeper1155Abi,
  functionName,
  args,
})
 
console.log('Tier info:', result)

Parameters

ParameterTypeDescription
contractAddressGatekeeper1155 contract address
tokenIdbigintToken tier ID
as'data' | 'args'Output format