@ticketrust/contracts-sdk
v0.0.15
Published
## Overview Ticketrust SDK is a powerful and easy-to-use Node.js module for interacting with Ticketrust smart contracts. It provides a simplified interface to the Ethereum blockchain for event ticketing, leveraging smart contracts for event management and
Downloads
5
Readme
Ticketrust SDK
Overview
Ticketrust SDK is a powerful and easy-to-use Node.js module for interacting with Ticketrust smart contracts. It provides a simplified interface to the Ethereum blockchain for event ticketing, leveraging smart contracts for event management and NFT-based ticketing.
Installation
npm install ticketrust-sdk
Importing
import { TicketrustInstance } from 'ticketrust-sdk';
Key Features
- Create and manage events using Ethereum smart contracts
- Mint tickets with various payment methods: ETH, fiat, or other tokens
- Advanced ticketing options, such as minting with exact ETH or tokens
- Retrieve event information and payee details
- Offchain URI support for event data
- Extensive event handling capabilities
Getting Started
Initialize the Ticketrust Instance
import { ethers } from "ethers"; import { TicketrustInstance } from 'ticketrust-sdk'; const provider = new ethers.providers.JsonRpcProvider('RPC_URL'); const wallet = new ethers.Wallet('PRIVATE_KEY', provider); const ticketrust = new TicketrustInstance(wallet);
Create an Event
const eventParams = { // Event parameters }; await ticketrust.createEvent(eventParams);
Mint Tickets Various minting functions are available depending on the payment method:
mintWithETH
mintWithToken
mintWithTokenForExactETH
mintWithETHForExactTokens
mintWithFiat
mintBatchWithFiat
Retrieve Event Information
const eventInfo = await ticketrust.getEventInfo(eventId);
API Reference
Please refer to the API documentation for detailed information about each function.
Contributing
Contributions are welcome! Please read our contributing guidelines before submitting pull requests.