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.
SDK
sidehallDomain(chainId, settlement)EIP-712 domain: name Sidehall, version 2hashInvite / hashQuote / hashMakerKeyDigests identical to the Solidity contractfeeOf(gross), sellerNet(gross), rankQuotes(side, quotes)Fee maths and rankinggenerateEncryptionKeyPair()X25519 key pair for HPKEsealInvite / openInvite / sealQuote / openQuoteEnvelopes bound to chain, deployment, request and recipientvalidateInvite / validateQuoteThe same checks as the desk, with typed reasonsverifyMakerKey({ binding, signature, … })Check a published key before sealing to itbuildReceipt / verifyReceiptReceipts straight from chain datacreateRelayClient({ 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.
| Step | Endpoint |
|---|---|
| Sign in | POST /api/auth/challenge, then POST /api/auth/verify with a Sign-In with Ethereum message |
| Publish a maker key | PUT /api/makers/me/key |
| Create a request | POST /api/rfqs with sealed invitations |
| Read your inbox | GET /api/inbox |
| Reply with a quote | POST /api/rfqs/:rfqId/quotes before the reply-by time |
| Read quotes for your request | GET /api/rfqs/:rfqId/quotes |
| Fills you took part in | GET /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.