Skip to main content
The Dapp API is where the SDK earns its place: it is the typed client for the surface the CLI cannot reach at all. Everything below targets sandbox on Sepolia (11155111), so nothing here moves real value.

Before you start

1

Get an API key

Request one. Every call below needs it.
2

Get your signer whitelisted

Brickken must whitelist the wallet you pass as signerAddress before any prepare accepts it. Ask for it in the same request as the key.
3

Fund that wallet with native gas

Dapp writes default to client-signed: you sign, Brickken broadcasts, and your wallet pays the gas — Sepolia ETH here.
The wallet that performs the first newTokenization becomes the tokenizer for that token. Only the tokenizer can mint it, whitelist its investors, or distribute its dividends. Your API key is also scoped to the symbols it tokenized — anything else raises UnauthorizedTokenSymbolError.

Set up the client once

write is the option object every step below reuses: execute: true prepares, signs, and sends in one call, and signerAddress is required in client-signed mode because prepare builds the transaction against that account’s nonce.
Drop execute: true from any step to prepare only and inspect result.transactions before committing. Chain ids accept decimal or 0x-prefixed hex — a bare aa36a7 is rejected.

1. Create the tokenized asset

The field is name, not tokenName. tokenType accepts EQUITY, DEBT, BILL_FACTORING, ICO, STABLECOIN, REVENUE_SHARE, RWA_TOKEN, or PROFIT_SHARING, and defaults to EQUITY. supplyCap defaults to 0, which means uncapped — set it deliberately. Confirm it exists:

2. Whitelist your investors

A security token only moves between whitelisted wallets. Whitelist before you mint or accept investment.
whitelistStatus: false removes an investor. Verify with:

3. Mint tokens

needWhitelist: true whitelists the recipient as part of the same mint, which collapses step 2 into step 3 when you are onboarding a new investor.

4. Launch the offering

Every one of those fields is required — the type will tell you if one is missing. Dates are ISO 8601, and acceptedCoin is a payment token symbol: USDT, USDC, or BKN. Once it is live, list your offerings and keep the uuid:

5. Take an investment

The investor signs this one, not the tokenizer — so build a second client with the investor’s signer, or pass their address as signerAddress.
The investor needs the payment token in their wallet, and prepare may return two transactions — an ERC-20 approve followed by the investment. The SDK signs and sends both, in order. Track progress:

6. Let investors claim their tokens

The investor signs this too.

7. Close the offering

8. Distribute dividends

Only the tokenizer can do this.

Broadcasting it yourself

Add rpcUrl to the client and executionMode: 'client-broadcast' to any step. You sign and submit through your own node, and the SDK confirms { txId, txHash } back to Brickken so the transaction still appears in get-transaction-status and in the dApp.
If the confirmation fails after a successful broadcast, catch BroadcastConfirmationError and resume only that step — see Execution modes.

When something fails

Each write method has its own credit balance, so exhausting mint credits does not block newSto. See Errors for the full list.

Namespaces

Every method above, mapped to its backend endpoint.

The same lifecycle over HTTP

The raw request bodies, if you would rather not use the SDK.