Skip to content
ROBINHOOD CHAIN TESTNET · ASSETS HAVE NO VALUE
SIDEHALL
DOCS · REFERENCE · 08 / 11

Developers

The SDK, typed data, relay API and test vectors for building makers and integrations.

The website, the relay and the indexer share one TypeScript SDK, so an integration that uses it hashes, seals and validates exactly as the desk does.

OpenAPI 3.1 manifest.json

SDK

  • sidehallDomain(chainId, settlement)
    EIP-712 domain: name Sidehall, version 2
  • hashInvite / hashQuote / hashMakerKey
    Digests identical to the Solidity contract
  • feeOf(gross), sellerNet(gross), rankQuotes(side, quotes)
    Fee maths and ranking
  • generateEncryptionKeyPair()
    X25519 key pair for HPKE
  • sealInvite / openInvite / sealQuote / openQuote
    Envelopes bound to chain, deployment, request and recipient
  • validateInvite / validateQuote
    The same checks as the desk, with typed reasons
  • verifyMakerKey({ binding, signature, … })
    Check a published key before sealing to it
  • buildReceipt / verifyReceipt
    Receipts straight from chain data
  • createRelayClient({ baseUrl })
    Typed wrappers for every relay endpoint
import { createRelayClient, sidehallDomain, sealQuote, quoteTypedData } from "@sidehall/sdk";

const domain = sidehallDomain(46630, "0x9B664E66B1f5729Ca34e4BaF0B4fC5961329C49d");
const relay = createRelayClient({ baseUrl: "https://<this site>" });

Typed data

Domain name
Sidehall
Version
2
Chain id
46630
Verifying contract
0x9B664E66B1f5729Ca34e4BaF0B4fC5961329C49d
Invite(bytes32 rfqId,address taker,address invitedMaker,bool takerBuysBase,address baseToken,address quoteToken,uint256 baseAmount,bytes32 replyKey,uint64 replyBy,uint64 executeBy)
Quote(bytes32 rfqId,address maker,address taker,bool takerBuysBase,address baseToken,address quoteToken,uint256 baseAmount,uint256 grossQuote,uint256 feeAmount,uint256 nonce,uint64 expiry)
MakerKey(address maker,bytes32 encryptionKey,uint64 version,uint64 expiresAt)

Invitations are signed but never sent on-chain. Changing network or contract needs new signatures.

Relay API

The relay is a JSON API under /api on the same origin as the site.

StepEndpoint
Sign inPOST /api/auth/challenge, then POST /api/auth/verify with a Sign-In with Ethereum message
Publish a maker keyPUT /api/makers/me/key
Create a requestPOST /api/rfqs with sealed invitations
Read your inboxGET /api/inbox
Reply with a quotePOST /api/rfqs/:rfqId/quotes before the reply-by time
Read quotes for your requestGET /api/rfqs/:rfqId/quotes
Fills you took part inGET /api/fills

Writes need the CSRF token returned at sign-in in the x-csrf-token header. Creating a request or a quote needs an idempotency-key header; repeating the same key with the same body is safe. Errors share one shape: {"error": {"code", "message"}}.

Test vectors

The downloads above are generated by the contract test suite. Hash and sign them in your own stack; your digests must match byte for byte.