@orangecheck/gate / assertOc
Function: assertOc()
function assertOc(req: MinimalReq, opts: GateOptions): Promise<GateDecision>;
Defined in: core.ts:131
Run the OrangeCheck lookup + threshold comparison for a request, without touching the response. Framework-agnostic. Use this directly in Fastify, Hono, Workers, or anywhere Express middleware doesn't fit.
const decision = await assertOc(req, { minSats: 100_000, address: { from: 'header' } }); if (!decision.ok) return res.status(403).json({ error: decision.reason });
Parameters
| Parameter | Type |
|---|---|
req | MinimalReq |
opts | GateOptions |
Returns
Promise<GateDecision>