Skip to content

Rewrite claim-ticket-stub as vanilla form; fix printed-stub typos#370

Open
magent-cryptograss wants to merge 1 commit into
cryptograss:productionfrom
magent-cryptograss:production
Open

Rewrite claim-ticket-stub as vanilla form; fix printed-stub typos#370
magent-cryptograss wants to merge 1 commit into
cryptograss:productionfrom
magent-cryptograss:production

Conversation

@magent-cryptograss

Copy link
Copy Markdown
Contributor

Prepares the ticket-stub claim UX to work seamlessly for fans who don't have a wallet and don't have ETH — the "mega seamless" bar we set for this whole rewrite. Also fixes two long-standing printed-stub typos.

Claim page rewrite

Strips wagmi / viem / @Web3Modal from `claim-ticket-stub.njk` entirely. The gasless architecture means the claim page never talks to a wallet directly — it just POSTs `{tokenId, secret, recipient}` to the delivery-kid relayer, which signs and submits the transaction on Optimism from its hot wallet.

  • Auto-populates the secret from the `?secret=` URL param (same as before)
  • POSTs to `https://delivery-kid.cryptograss.live/claim-ticket-stub\`
  • Renders `info` / `success` / `danger` bootstrap alerts through the request lifecycle
  • On success, shows the transaction hash with an Optimistic Etherscan link and the contract-address link too
  • ENS resolution moves server-side — the page sends the raw address-or-ENS string and displays what the backend resolved
  • SetStone upsell block preserved as-is (it's driven by `strike_set_stones.js` which has its own wagmi config; the inline module strip doesn't affect it)

Note: the delivery-kid endpoint at `POST /claim-ticket-stub` is task #13 — not yet implemented. Deploying this page against the current backend will show a network-error alert until that endpoint lands.

Printed-stub typos

Two placeholders that were literal strings baked into the templates and — because we've been printing stubs since Prague 2025 — got printed onto real paper stubs:

  • `single-ticket-stub.njk`: the "Click here to claim / move this ticket stub" link was hardcoded to `/blox-office/claim/blah blah` — never updated from placeholder. Now points at the real per-token claim URL with the secret pre-populated.
  • `ticketstub-front.njk` and `ticketstub-back.njk`: the token-range text under the tokenId was literal `{100-149}` on the front and `{50-99}` on the back. Now renders `{{ show.firstTokenId }}-{{ show.lastTokenId }}` from the actual show data.
  • `setstone_utils.js`: adds `firstTokenId` and `lastTokenId` to the show object during stub generation so the templates have real values to render.

Files touched

  • `src/build_logic/setstone_utils.js`
  • `src/sites/cryptograss.live/templates/pages/claim-ticket-stub.njk`
  • `src/sites/cryptograss.live/templates/partials/ticketstub-front.njk`
  • `src/sites/cryptograss.live/templates/partials/ticketstub-back.njk`
  • `src/sites/cryptograss.live/templates/reuse/single-ticket-stub.njk`

Test plan

  • Skim the claim page diff — no wagmi/viem imports remaining
  • Verify printed stub template renders the actual token range (build a preview and inspect front + back for a show like `0-25247741`)
  • Load a claim page locally, confirm the ?secret= param populates the secret field
  • Confirm the SetStone upsell block still renders when `show.ticketStubs.length > 0`
  • `npm test` — pre-existing `show_sorting_test.js` failures are unrelated to this PR; the ticket-stub suite still shows 32 pass

Follow-up (blocking full functionality)

Claim page:
- Strip wagmi/viem, @wagmi/core, @Web3Modal, viem imports and the
  entire <script type="module"> block. The gasless architecture means
  the claim page never talks to a wallet directly — it just POSTs
  {tokenId, secret, recipient} to the delivery-kid relayer, which
  handles the signed transaction on Optimism from its hot wallet.
- Vanilla script: auto-populates the secret from the ?secret= URL
  param (same as before), submits to
  https://delivery-kid.cryptograss.live/claim-ticket-stub, renders
  loading/success/error alerts, and on success shows the transaction
  hash with an Optimistic Etherscan link.
- ENS resolution moves server-side; the page just sends the raw
  address-or-ENS string and displays what the backend resolved.
- SetStone upsell block preserved as-is. It's driven by
  strike_set_stones.js which has its own wagmi config, so the inline
  module strip doesn't affect it.

Printed-stub typos:
- single-ticket-stub.njk: the "Click here to claim / move this ticket
  stub" link was hardcoded to /blox-office/claim/blah blah — never
  updated from placeholder. Now points at the real per-token claim
  URL with the secret pre-populated.
- ticketstub-front.njk and ticketstub-back.njk: the token-range text
  under the tokenId was literal "{100-149}" and "{50-99}" — literal
  strings in the template, printed onto real paper stubs at every
  show since Prague. Now renders {{ show.firstTokenId }}-{{
  show.lastTokenId }} from the actual show data.
- setstone_utils.js: adds firstTokenId and lastTokenId to the show
  object during stub generation so the templates have real values to
  render.

The delivery-kid endpoint at /claim-ticket-stub is task cryptograss#13 — not yet
implemented. Deploying this page against the current backend will show
a network error alert until the endpoint lands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants