Skip to content

API and SDK

Base URL: https://api.bricsfinance.fun. The full contract is the OpenAPI document.

Read the ledger

curl https://api.bricsfinance.fun/v1/ledger
curl https://api.bricsfinance.fun/v1/policy
curl https://api.bricsfinance.fun/v1/epochs?limit=5

SDK

The SDK lives in sdk/ts in the repository. It is not published to npm yet.

import { Brics } from './sdk/ts/src/index';

const brics = new Brics();
const ledger = await brics.ledger();
const tower = await brics.tower('YourWalletAddress');
const proof = await brics.proof(12, 'YourWalletAddress');

Signing in

  1. POST /v1/auth/nonce with { chain, address } returns the message to sign.
  2. Sign it with the wallet.
  3. POST /v1/auth/verify with { nonce, signature } starts a session. SDK clients send x-brics-client: sdk to get a bearer token.

Nonces work once and expire after five minutes.

Limits

120 requests per minute per IP and bodies up to 64 KB. Errors look like { "error": "code", "message": "…" }.