THE TOTYM SDK / @totym/sdk
Build the door
into anything.
Turn what a wallet holds into what your app opens. One ownership check can change a whole site, a page, or a single line.
npm install @totym/sdkPublished on npm · Solana, Ethereum, Base and Robinhood Chain · server-side checks
No qualifying holding. The gate stays closed.
01 / GRANULARITY
ONE PRIMITIVE. ANY SCALE.The smallest thing
can be the whole point.
Choose where the door lives. The ownership rule stays the same; the experience around it is yours.
<MemberChart /> / Gated
One component.
Put a chart or feed behind a gate while the rest stays public.02 / THE GATE LAB
INTERACTIVE SIMULATIONFour ways to
hold the door.
Switch the locked state. Then simulate a holder to see what opens. This is a visual model of the SDK behavior, not a live wallet check. Three of the four decide what a visitor SEES; only TotymServerGate decides what gets sent.
STYLE / BLOCK
Block the content.
The protected children really are absent from the DOM — the Elements inspector shows nothing. But they were sent: React serialises a client component's children before the component runs, so the text sits in the response body and view-source finds it. The DOM is clean; the response is not. Use TotymServerGate when it must not be sent at all.
<TotymReveal tier="holder" style="block">
<Members />
</TotymReveal>For sensitive data, verify on the server before returning it.
03 / THE PRIMITIVE
WALLET STATE, INTO PRODUCT STATE.The rule lives
beneath the design.
Use Totym to decide access. Keep the interface yours. A gate can sit around the precise thing ownership should open.
View the published packageimport { TotymProvider, TotymReveal } from "@totym/sdk";
<TotymProvider apiUrl="YOUR_TOTYM_API_URL">
<TotymReveal mint="TOKEN_MINT_ADDRESS" chain="solana">
<PromoCode />
</TotymReveal>
</TotymProvider>Starter pattern. Supply your API URL and token mint. You can pass your wallet address to TotymProvider when your app already manages wallet connections.
A wallet connects through your experience.
The access decision checks ownership on the server.
Your application renders the qualifying view.
04 / REFERENCE
THE PUBLISHED SURFACE.Everything on the table.
The public exports and endpoints of @totym/sdk. Consult the published type declarations for signatures and parameters.
SDK exports
11| Name | Kind | Purpose |
|---|---|---|
proveWallet | function | Prove the visitor controls the wallet — signed challenge, short-lived token |
requireTotymAccess | server | Server-side guard. From @totym/sdk/server |
bearerFrom | server | Read the token out of request headers |
TotymServerGate | rsc | Decides on the server before rendering — withheld children are never sent. From @totym/sdk/rsc |
sessionCookie | rsc | Build the Set-Cookie value the server gate reads |
TOTYM_SESSION_COOKIE | rsc | The cookie name it reads, so you never guess it |
TotymUnavailableError | server | The check could not be COMPLETED — never means denied |
TotymProofError | class | proveWallet failed; carries the HTTP status |
TotymProvider | component | App configuration, wallet and access cache |
TotymReveal | component | Block, fade or blur gated children in the browser — hides, does not withhold |
TotymGate | component | Deprecated alias for TotymReveal, kept so an upgrade does not break a build |
TotymTier | component | Select the highest qualifying tier |
TotymWall | component | Default locked state and buy link |
TotymButton | component | Wallet connection for either ecosystem |
useTotymAccess | hook | Read access state for a query |
useTotymTier | hook | Read the qualifying tier name |
useTotymWallet | hook | Read the connected wallet and ecosystem |
defineConfig | function | Type a community and tier configuration. From @totym/sdk/config in a server file |
detectChain | function | Detect Solana or EVM address shape. Also at @totym/sdk/config |
clearCache | function | Invalidate the client access cache |
EVM_CHAIN_IDS | constant | Chain ids for the EVM chains the API serves. Also at @totym/sdk/config |
Public endpoints
12six of these are CORS-open, so a browser on any origin can read them. Every example below returns 200 — paste one. The whole surface is also machine-readable at /api and /llms.txt, both generated from the same declaration as this table.
| Path | Chain | Returns |
|---|---|---|
/api/sdk/challenge/api/sdk/challenge | Solana · EVM | A single-use nonce and the exact message to sign |
/api/sdk/session/api/sdk/session | Solana · EVM | A short-lived token, in exchange for a signature over the challenge |
/api/sdk/access/api/sdk/access | Solana · EVM | A verified access decision — allow, deny or unknownNo wallet parameter exists on this route. The token proves the address, which is the difference between this and the lookups below. |
/api/check-access/api/check-access?wallet=6J8eyphbPTvvUtswqbcfxSdZJF88pbWFoeYmYcN7pD4c&mint=So11111111111111111111111111111111111111112&minimum=0 | Solana | The balance an address holds of a mint, and whether it clears a minimumAnswers about an address the CALLER supplied, so every response carries verified: false. Gating on it opens the door for anyone who pastes a whale's address. Use /api/sdk/access for a decision. |
/api/check-access-evm/api/check-access-evm?wallet=0x6262032b8a6f82d7c63897bc44288f76753f8442&contract=0x4200000000000000000000000000000000000006&chain_id=8453&gate_type=erc20&minimum=0 | Ethereum · Base · Robinhood Chain | The same, for EVM chainsSame verified: false caveat as the Solana lookup. |
/api/token-metadata/api/token-metadata?mint=So11111111111111111111111111111111111111112 | Solana | Name, symbol, logo and supply for a mint |
/api/token-metadata-evm/api/token-metadata-evm?contract=0x4200000000000000000000000000000000000006&chain_id=8453 | Ethereum · Base · Robinhood Chain | The same, for an ERC-20 or ERC-721 contract |
/api/holder-count/api/holder-count?mint=So11111111111111111111111111111111111111112 | Solana | How many addresses hold a mint |
/api/profile/api/profile?wallet=6J8eyphbPTvvUtswqbcfxSdZJF88pbWFoeYmYcN7pD4c | Solana · EVM | A wallet's Totym profile, with ENS and .sol names where they resolve |
/api/communities/api/communities?limit=10 | Solana · EVMsame-origin | Published communities, with each one's gate, chain and token |
/api/communities/count/api/communities/count | —same-origin | Population counts — published, paused, unclaimed listings, test, archived, total rows, and membershipsThe populations are named, not partitioned — a devnet row can also be archived — so they deliberately do not sum to rows. |
/api/health/api/health | —same-origin | Every dependency with its state, latency and what breaks without it. No provider text reaches the caller. |
The repository is useTotym/TotymSDK and the package is @totym/sdk. The published 0.3.0 still lists the pre-rename URL in its npm metadata — GitHub redirects it, and it corrects on the next publish rather than being something you need to work around.
Closed source. Said plainly rather than left to be inferred from a missing link: the server that makes gate decisions is not currently something you can read. The commit below identifies the build you are served, and the SDK above is the part you can verify independently.
THE DOOR IS YOURS TO BUILD.
Give ownership
something to open.
Start with a component. Make it a whole world.
npm install @totym/sdk