v1 source realm
Package tickets is GnoRadio's concert tickets rules, release 1. Concerts belong to artist profiles of the catalog; a ...
Package tickets is GnoRadio's concert tickets rules, release 1. Concerts belong to artist profiles of the catalog; a ticket is a GRC721 NFT of the permanent realm gno.land/r/nym-alexiscolin000/gnoradio/tickets/nft, drawn on-chain. Ticket money goes straight to the artist's owner address in the same transaction, the service fee to the GnoRadio treasury: this realm ends every transaction holding no coins.
It keeps no state but its admin role. Every record lives in the data realm, in the "tickets/…" collections only the current tickets writer may change (db.gno), and the NFTs in the NFT realm, which only that writer drives: a later release takes over both without copying anything.
32
func ArtistEvents
ActionArtistEvents returns up to limit visible concert ids of an artist, newest first.
func Attended
ActionAttended returns how many concerts a holder checked in at.
func BuyTicket
crossing ActionBuyTicket mints a ticket to the caller. A paid ticket needs the exact price plus the service fee attached: the price goes straight to the artist, the fee to the GnoRadio treasury.
func CancelEvent
crossing ActionCancelEvent stops ticket sales. GnoRadio never held the payments: they went straight to the artist, who handles refunds directly. Artist owner only.
func CheckIn
crossing ActionCheckIn marks a ticket as used at the door; its holder earns the "I was there" stamp. The concert's artist owner only, while the door is open, and only for a ticket its current holder presented (Present) with this door code in the last 10 minutes.
func CreateEvent
crossing ActionCreateEvent announces a concert by the caller's artist profile. start is "YYYY-MM-DD HH:MM" in UTC; price is in GNOT ("0" for free, "2.5"); link is an optional https URL (stream or venue page, public).
func EventCount
Actionfunc EventSVG
ActionEventSVG returns the specimen ticket of a visible concert as a markdown image, or "" when the concert is not visible.
func EventsJSON
ActionEventsJSON pages through concerts, newest first (limit <= 50): offset and limit count stored concerts, hidden ones are left out of the page, and "next" gives the offset of the following page (0 at the end). upcoming=true lists future, not cancelled, visible concerts instead, soonest first, with offset and limit counting listed concerts ("next" is then a listed-concert offset, 0 when the scan ended).
func FeesJSON
ActionFeesJSON returns the ticket service fee and where it goes.
func HiddenNote
ActionHiddenNote says why a concert is hidden: "Removed by moderation: <reason>", or "".
func HideEvent
crossing ActionHideEvent hides or restores a concert. Admin only; hiding takes a public reason (4-200 characters). Tickets stay with their holders.
func OfferAdmin
crossing ActionOfferAdmin offers the admin role to an address (offering it to the admin cancels the offer); AcceptAdmin takes it. Each change is mirrored to the data realm, so the next release keeps the admin.
func PastEvents
ActionPastEvents returns up to limit (1-100) ids of the concerts that have started, were not cancelled and are not hidden, latest first from offset, and how many there are. The start-time index pages them: cancelled or hidden concerts take no room, however many there are.
func Present
crossing ActionPresent shows a ticket at the door: its holder signs from their own wallet, with the door code the staff's screen shows after scanning the ticket's QR. A QR built from public data (the ticket id and its holder) cannot do that for them, and a stranger with a copied QR gets another code: the holder's Present does not admit them. CheckIn then admits the ticket with that code for 10 minutes. Only while the door is open: from 12h before the concert to 12h after its start.
func PresentedAt
ActionPresentedAt is when the ticket's current holder last presented it at the door (Present) with this door code, unix seconds; 0 when they did not, or it changed hands since, or it was checked in. CheckIn takes it for 10 minutes.
func Ready
crossing ActionReady tells the data realm that this release is on chain (see data.Propose). Anyone may call it.
func RefreshArtist
crossing ActionRefreshArtist re-reads an artist's visibility in the catalog and updates the Upcoming index for its future concerts (at most maxOpenAhead): once moderators hide a profile, its concerts stop taking places in the Upcoming scan; a restored artist's come back. Anyone may call it.
func RefreshArtistPast
crossing ActionRefreshArtistPast does the same for up to 50 of an artist's past concerts from offset (oldest first; the 500 an artist may have take ten calls), so a hidden profile's past concerts leave the past-concerts index too. Anyone may call it.
func Render
Render points gnoweb visitors to the GnoRadio site; a retired release says which realm took over.
func RenounceAdmin
crossing ActionRenounceAdmin gives the admin role up for good, for this release and the next ones.
func ServiceFee
ActionServiceFee returns the per-ticket service fee in ugnot (0 while no treasury is set).
func SetServiceFee
crossing ActionSetServiceFee sets the per-ticket service fee in ugnot (0..10 GNOT), paid by buyers of paid tickets on top of the price and forwarded to the GnoRadio treasury. Admin only.
func TicketCount
Actionfunc TicketSVG
ActionTicketSVG returns a ticket as a markdown image, or "" if unknown.
func TicketsOf
ActionTicketsOf returns up to limit ticket ids held by owner, newest first.
func TicketsOfJSON
ActionTicketsOfJSON lists the tickets held by owner, newest first (<= 50).
func TransferTicket
crossing ActionTransferTicket gives one of the caller's tickets to someone else. There is no built-in resale market.
func EventInfo
ActionEventInfo returns a copy of a visible concert; ok is false otherwise.
func Upcoming
ActionUpcoming returns up to n visible, not cancelled future concerts, soonest first.
func TicketInfo
ActionTicketInfo returns a copy of a ticket.
2
type Event
structEvent is a concert.
type Ticket
structTicket is one NFT ticket.
14
- chain stdlib
- chain/banker stdlib
- chain/runtime stdlib
- chain/runtime/unsafe stdlib
- gno.land/p/nym-alexiscolin000/gnoradio/role/v0 package
- gno.land/p/nym-alexiscolin000/gnoradio/safe/v0 package
- gno.land/p/nym-alexiscolin000/gnoradio/store/v0 package
- gno.land/p/nym-alexiscolin000/gnoradio/text/v0 package
- gno.land/r/nym-alexiscolin000/gnoradio/catalog/v1 realm
- gno.land/r/nym-alexiscolin000/gnoradio/data realm
- gno.land/r/nym-alexiscolin000/gnoradio/tickets/nft realm
- strconv stdlib
- strings stdlib
- time stdlib