Libticketto
    Preparing search index...

    Interface TicketsCalls

    A list of possible transactions to interact with tickets.

    interface TicketsCalls {
        acceptPendingTransfer(eventId: number, id: bigint): Promise<void>;
        buy(issuer: number, id: bigint): Promise<void>;
        cancelPendingTransfer(eventId: number, id: bigint): Promise<void>;
        initiatePendingTransfer(
            eventId: number,
            id: bigint,
            beneficiary: string,
        ): Promise<void>;
        issue(issuer: number): Promise<bigint>;
        sell(issuer: number, id: bigint, receiver: string): Promise<void>;
        submitAttendanceCall(input: Uint8Array): Promise<void>;
        withdrawSell(issuer: number, id: bigint): Promise<void>;
    }
    Index

    Methods

    • Accepts the transfer of a ticket.

      Parameters

      • eventId: number
      • id: bigint

        The TicketId of the ticket to be transferred

      Returns Promise<void>

      An error if the signer of the command is not the beneficiary of the ticket.

    • Buys a ticket that is set for sale.

      Parameters

      • issuer: number

        The EventId of the event that issued the ticket to be bought

      • id: bigint

        The TicketId of the ticket to be bought

      Returns Promise<void>

      An error if the signer of the command doesn't have enough funds to buy it.

    • Accepts the transfer of a ticket.

      Parameters

      • eventId: number
      • id: bigint

        The TicketId of the ticket to be transferred

      Returns Promise<void>

      An error if the signer of the command is not the initial owner or the beneficiary of the transfer.

    • Creates a deferred transfer of the ticket to a different holder. This creates a pending transfer state, where the beneficiary can accept the transfer, or either the initial owner or the beneficiary of the ticket can cancel the transfer.

      This intermediate state is closed once one of the two aforementioned actions is executed.

      Parameters

      • eventId: number
      • id: bigint

        The TicketId of the ticket to be transferred

      • beneficiary: string

        The AccountId that will receive the ticket

      Returns Promise<void>

      An error if the signer of the command is not the owner of the ticket, or if there's a restriction to transfer tickets.

    • Executes a permissionless issuance for a new ticket for attending an event.

      Parameters

      • issuer: number

        The AccountId associated to the event that issues the ticket.

      Returns Promise<bigint>

      The TicketId of the newly created ticket

      When the amount of issued ticket exceeds the event capacity.

    • Sets the ticket as for sale (if possible).

      Parameters

      • issuer: number

        The EventId of the event that issued the ticket to be transferred

      • id: bigint

        The TicketId of the ticket to be transferred

      • receiver: string

        The AccountId that will receive the ticket

      Returns Promise<void>

      An error if the signer of the command is not the owner of the ticket, or if there's a restriction to resell tickets.

    • Updates the information of an event call to mark an attendance to an event with a valid ticket.

      Parameters

      • input: Uint8Array

        A signed call to mark the attendance.

      Returns Promise<void>

      A confirmation that the attendance was marked successfully.

      An error in case the attendance is not valid.

    • Cancels the sale of the ticket.

      Parameters

      • issuer: number

        The EventId of the event that issued the ticket to be transferred

      • id: bigint

        The TicketId of the ticket to be transferred

      Returns Promise<void>

      An error if the signer of the command is not the owner of the ticket.