Smart Contract Requests

Prerequisites

For this section, you will need:

  • A user's Theta Network wallet address, see the previous page on how to obtain this

  • A web3 library installed, such as ethers.js, and connected to the Theta Mainnet RPC endpoint

  • The smart contract address(es) of your event

Checking ownership of a ticket

import { useWeb3React } from '@web3-react/core'

const { library } = useWeb3React()

async function getTicketContractBalance(ticketAddress: string, library: any) {
  return library.getBalance(ticketAddress)
}

Stamping a ticket

This requires a smart contract interaction, and therefore will cost gas. You will need to obtain an intstance of ticket contract first.

Last updated