com.livtet.giveaway.draw

Conclude a giveaway: draw the winners from the entries the activity index holds. Authenticated with an atproto service JWT minted by the author's own PDS (`aud` this AppView's `did:web`, `lxm` this NSID); the issuer must be the giveaway record's author. Idempotent: the first call stores the seed and the winners it drew, and every later call answers that same row instead of drawing again.

Details · procedure
Kindprocedure
Authoritygiveaway.livtet.com
Commit rev3n3l6g2waludu
Indexed

Procedure

procedure · POST

Input

application/json

giveaway

requiredstring · at-uri

AT-URI of the giveaway to conclude.

Output

application/json

drawnAt

requiredstring · datetime

entries

requiredinteger

How many distinct entrants the draw covered.

  • minimum: 0

giveaway

requiredstring · at-uri

seed

requiredstring

The stored seed the draw was made from, so a result stays reproducible.

winners

requiredarray
itemsstring · did

Errors

AuthRequired

No service JWT, or one that does not verify.

InvalidRequest

The input body is not `{ giveaway }` naming an at-uri.

NotFound

No giveaway record exists at the given AT-URI.

NotAuthor

The token's issuer is not the giveaway record's author.

NotClosed

The giveaway is still open; it cannot be drawn before its close time.