Office Noun

newoffice ui kit, the look behind doors, faucets and pools as one stylesheet. one link tag, cc0.

tezos desk kit · cc0

tezos desk kit
one script, one stylesheet.

one script and one stylesheet. point it at a tezos address and it shows the balance, the counts, and the latest mints, each linked to its objkt page. no dependencies, no build step. it renders a snapshot first if you give it one, then asks the chain.

install

three lines.
paste them anywhere.

<link rel="stylesheet" href="https://officenoun.xyz/kit/tezos-desk.css">
<script src="https://officenoun.xyz/kit/tezos-desk.js"></script>
<div data-tezos-desk data-wallet="tz1UWibBbQXvuSkThsLUGAaL4R5j7X3PSCKj"></div>

options

  • data-wallet required. a tz1 to tz4 address.
  • data-title heading. default "the wallet".
  • data-limit how many mints to show. default 12, from 1 to 48.
  • data-snapshot id of a <script type="application/json"> holding a fallback snapshot.
  • data-api indexer base url. default https://api.tzkt.io.
  • data-images set to "ipfs" to show only ipfs images. other cards get the placeholder.

theming

  • set these on the element or any parent. all are optional.
  • --td-ink text and rules.
  • --td-muted labels and small print.
  • --td-paper card background.
  • --td-line borders and empty image boxes.
  • --td-accent accent colour. the focus ring uses the ink colour.
  • --td-font font stack.

demo

the collector.
live from the chain.

this demo sets the --td-* colours from the page, so it follows light and dark.

the door

sign in.
move nothing.

a second script. connect a tezos wallet and sign in with a plain text message. connecting shares the address. signing in moves nothing.

install the door

<link rel="stylesheet" href="https://officenoun.xyz/kit/tezos-desk.css">
<script src="https://officenoun.xyz/kit/tezos-door.js"></script>
<div data-tezos-door></div>

the wallet library (beacon sdk 4.8.1, about 4 mb) is not loaded with the page. it loads from unpkg.com on the first click, and not before. after that the sdk talks to beacon's relay servers and, for some wallets, walletconnect servers.

who gets contacted: on load the desk asks api.tzkt.io and the image hosts in the token metadata. the door contacts nobody on load.

door options

  • data-app name shown in the wallet prompt. default the page hostname.
  • data-network default "mainnet".
  • data-statement the one line the user signs. default "sign in to {host}. this moves nothing."
  • data-sdk url of the beacon sdk browser bundle. default a pinned unpkg url. https only (http for localhost). refused with "no fingerprint for that sdk." unless data-sdk-integrity is also set. a beacon already on the page is ignored.
  • data-sdk-integrity sha-384 integrity for a custom data-sdk. the default url ships with its own.
  • data-nonce a nonce your server issued, 8 to 128 characters of letters, digits, _ and -. used as the nonce line. anything else shows "bad nonce.".

door events

  • all bubble from the element. detail is below.
  • tezosdoor:connect address, publicKey, network.
  • tezosdoor:disconnect address.
  • tezosdoor:signin the session: address, publicKey, message, payloadHex, signature, issued, expires.
  • tezosdoor:signout address.

the fine print

a sign-in is a claim.
until your server checks it.

what the door does not do

  • no transactions. it asks the wallet for the sign permission only and never builds or sends an operation.
  • no signature verification. the session is only a claim.
  • no keys. it never asks for a secret key or a seed phrase.

restored sessions

a session left in the tab by an earlier load is never shown as signed in. if it looks valid and is under 12 hours old, the door says "connected earlier as tz1abc…wxyz. not checked." and offers "sign in again" or "forget". getSession() returns null until a fresh sign-in on this page load.

before you trust a sign-in

a site that wants to trust a sign-in has to do all four of these on its server:

  1. recompute the payload from the message and check the signature.
  2. derive the tz address from the public key itself, or fetch the key from the chain. never trust the session's address field.
  3. issue the nonce on the server (data-nonce) and accept it once.
  4. check that the host and uri lines match your site, and that now is before expires.

until all four are done, a session is only a claim.