(Build)

SDK

One dependency-free file: seal, price, query.

The SDK is one ES module with no dependencies, served at /sdk/darkroom.mjs. It runs in browsers and in Node 20 or later.

import { room, sealFor, quote, query } from 'https://darkroomcoin.com/sdk/darkroom.mjs'

const r = await room()                                  // the room's key and status
const sealed = await sealFor(r, 'dream', new TextEncoder().encode('…'))
const q = await quote({ kinds: ['ride'], question: 'commute minutes by weekday', negatives: 412 })
const res = await query({ kinds: ['ride'], question: 'commute minutes by weekday', negatives: 412 })
// res.status is 402 with the x402 requirements, or a refusal that cost nothing

sealFor uses the same HPKE suite as the site: X25519, HKDF-SHA256, AES-128-GCM, with kind|room as associated data.

$DARKROOMCA at launch