new ZendServer(apiKey, baseUrl?)
string
required
Your app key, from
zend apps create or zend apps rotate-key.string
default:"https://api.usezend.app"
API host. Change it only for a non-production environment.
Error with code (Zend’s error code) and status (HTTP status).
verifySession(appSession)
Exchange theappSession from zend.identity.get() for the verified user.
createInteraction(params)
Create an interaction on behalf of a user who has connected your app.getInteraction(id)
updateInteraction(id, params)
Move an interaction along. Your server can makeserverOnly moves that pages can’t.
getPrize(id)
The prize and every joined player’saddress and app_user_id.
resolvePrize(id, winners, amountsUsd, resolverSeedHex, correction?)
Signs the result with your resolver key and posts it.
Payout happens after the dispute window unless the host cancels. See Prizes.
verifyWebhook(rawBody, header, secret, toleranceSecs?)
Returnstrue when x-zend-signature matches the raw body and is no older than toleranceSecs (default 300). Pass the raw body, before JSON parsing. See Webhooks.
verifyAttestation(receipt, zendPublicKeyHex)
Returnstrue when an attestation receipt’s hash and Zend’s signature are valid. Get the key from GET /apps/attest/key. See Attestations.
resolverKeyFromSeed(seedHex)
Returns{ privateKey, publicKeyHex } for a 32-byte hex seed. publicKeyHex is the value for resolverKey in your manifest. zend apps resolver-key does this for you.
prizeResultMessage(prizeId, winners, amounts, correction?)
The exact bytes your resolver key signs, matchingzend::prize::result_message. resolvePrize uses it; you only need it if you sign results somewhere else.