Explore every Intuition protocol function through interactive forms — create atoms, make deposits, query vault state, and more.
Intuition is a protocol for creating and relating knowledge on-chain. Atoms are pieces of data (a person, a concept, a URL). Triples are relationships between atoms (e.g., "Alice is-a Developer"). Signals are economic commitments — you stake tokens to express conviction about atoms or triples. Learn more about primitives and the protocol in the Intuition docs.
For AI agents: Give your agent this entire README. It contains the file map, code paths, and constraints your agent needs to understand and extend this template. Agent-specific rules live in
.agents/INSTRUCTIONS.mdand are symlinked toCLAUDE.md,CODEX.md, andAGENTS.mdvia agentsync — your agent will pick them up automatically regardless of which tool you use.
- Interactive forms for every protocol function: create atoms, look up data, make deposits, redeem positions, and query vault state.
- Shows the full flow for each operation: connect wallet, call the protocol, and see the decoded on-chain result.
- Everything talks directly to the Intuition smart contract — no extra layers in between.
git clone <your-fork-or-template-url>
cd intuition-basic-template
bun install
cp .env.example .env
bun devBuild for production:
bun run build
bun previewNote: Bun reserves bun build for its own bundler command, so use bun run build for the Vite production build.
- Single-page SPA with six protocol tabs: Atoms, Triples, Deposits, Redemptions, Vault State, Protocol Config.
- Wallet and chain state come from wagmi + RainbowKit.
- Every protocol call lives in
src/lib/protocol.ts. - No GraphQL, no indexer, no server component layer, no wrapper abstractions.
- All forms are intentionally wallet-gated so the UI behavior stays consistent across writes and wallet-aware preview reads.
| File | Purpose |
|---|---|
src/main.tsx |
Provider stack: WagmiProvider -> QueryClientProvider -> RainbowKitProvider -> App |
src/config/wagmi.ts |
RainbowKit/wagmi setup using intuitionTestnet from @0xintuition/protocol |
src/lib/protocol.ts |
Core teaching file: configs, parsing, defaults, write/read wrappers, event decoding |
src/components/FormPanel.tsx |
Reusable card + form + loading/error/result wrapper |
src/components/ResultDisplay.tsx |
Shared renderer for tx events, reads, and config structs |
src/components/sections/AtomsSection.tsx |
Atom create/read/preview panels |
src/components/sections/TriplesSection.tsx |
Triple create/read/preview panels |
src/components/sections/DepositsSection.tsx |
Deposit + batch + preview panels |
src/components/sections/RedeemSection.tsx |
Redeem + batch + preview/max panels |
src/components/sections/VaultSection.tsx |
Vault state reads |
src/components/sections/ConfigSection.tsx |
Global config + fee calculators |
src/App.tsx |
Tabbed shell that composes all six sections |
Start here: The three most important functions are
multiVaultCreateAtoms(create an atom),multiVaultDeposit(signal on any atom or triple), andmultiVaultGetAtomCost(query the current creation cost). Everything else builds on these.
| Function | Type | Args / UI Inputs | Returns |
|---|---|---|---|
multiVaultCreateAtoms |
Write | atomText -> toHex(text)[]; assets auto-filled from multiVaultGetAtomCost() |
txHash, explorer URL, decoded AtomCreated[] |
multiVaultGetAtom |
Read | atomId: bytes32 |
raw atomData bytes + decoded string when possible |
multiVaultIsTermCreated |
Read | termId: bytes32 |
boolean |
multiVaultGetAtomCost |
Read | none | current atom cost |
multiVaultGetAtomConfig |
Read | none | { atomCreationProtocolFee, atomWalletDepositFee } |
multiVaultPreviewAtomCreate |
Read (wallet-aware) | termId: bytes32, assets: uint256 |
{ shares, assetsAfterFixedFees, assetsAfterFees } |
| Function | Type | Args / UI Inputs | Returns |
|---|---|---|---|
multiVaultCreateTriples |
Write | subjectIds[], predicateIds[], objectIds[]; assets auto-filled from multiVaultGetTripleCost() |
txHash, explorer URL, decoded TripleCreated[] |
multiVaultGetTriple |
Read | tripleId: bytes32 |
{ subjectId, predicateId, objectId } |
multiVaultIsTriple |
Read | tripleId: bytes32 |
boolean |
multiVaultGetTripleCost |
Read | none | current triple cost |
multiVaultGetTripleConfig |
Read | none | { tripleCreationProtocolFee, atomDepositFractionForTriple } |
multiVaultGetInverseTripleId |
Read | tripleId: bytes32 |
inverse triple ID |
multiVaultIsCounterTriple |
Read | tripleId: bytes32 |
boolean |
| Function | Type | Args / UI Inputs | Returns |
|---|---|---|---|
multiVaultDeposit |
Write | receiver, termId, curveId, minShares, assets |
txHash, explorer URL, decoded Deposited[] |
multiVaultDepositBatch |
Write | receiver, termIds[], curveIds[], assets[], minShares[] |
txHash, explorer URL, decoded Deposited[] |
multiVaultPreviewDeposit |
Read (wallet-aware) | termId, curveId, assets |
{ shares, assetsAfterFees } |
| Function | Type | Args / UI Inputs | Returns |
|---|---|---|---|
multiVaultRedeem |
Write | receiver, termId, curveId, shares, minAssets |
txHash, explorer URL, decoded Redeemed[] |
multiVaultRedeemBatch |
Write | receiver, termIds[], curveIds[], shares[], minAssets[] |
txHash, explorer URL, decoded Redeemed[] |
multiVaultPreviewRedeem |
Read (wallet-aware) | termId, curveId, shares |
{ assetsAfterFees, sharesUsed } |
multiVaultMaxRedeem |
Read | sender, termId, curveId |
max redeemable shares |
| Function | Type | Args / UI Inputs | Returns |
|---|---|---|---|
multiVaultGetVault |
Read | termId, curveId |
{ totalShares, totalAssets } |
multiVaultGetShares |
Read | account, termId, curveId |
share balance |
multiVaultCurrentSharePrice |
Read | termId, curveId |
share price |
multiVaultConvertToAssets |
Read | termId, curveId, shares |
converted asset amount |
multiVaultConvertToShares |
Read | termId, curveId, assets |
converted share amount |
| Function | Type | Args / UI Inputs | Returns |
|---|---|---|---|
multiVaultGetGeneralConfig |
Read | none | global config struct |
multiVaultEntryFeeAmount |
Read | assets |
entry fee amount |
multiVaultExitFeeAmount |
Read | assets |
exit fee amount |
multiVaultProtocolFeeAmount |
Read | assets |
protocol fee amount |
- Build
ReadConfig/WriteConfigwithgetReadConfig()andgetWriteConfig(). - Resolve payable amounts when required.
- Atoms:
multiVaultGetAtomCost() - Triples:
multiVaultGetTripleCost()
- Atoms:
- Normalize UI input.
- Atom text ->
toHex(text) - CSV / newline batch fields -> arrays
- Blank receiver -> connected wallet address
- Atom text ->
- Execute the protocol helper.
- Wait for the receipt and parse the emitted events.
- Render
txHash, explorer link, and decoded event tables.
- Build
ReadConfig. - Parse user input into protocol-native values (
bytes32,uint256,address). - Call the corresponding helper from
@0xintuition/protocol. - Normalize tuples/structs into plain objects.
- Render a key/value table through
ResultDisplay.
Core imports used in this template:
import {
intuitionTestnet,
getMultiVaultAddressFromChainId,
multiVaultCreateAtoms,
multiVaultCreateTriples,
multiVaultDeposit,
multiVaultRedeem,
eventParseAtomCreated,
eventParseTripleCreated,
eventParseDeposited,
eventParseRedeemed,
type ReadConfig,
type WriteConfig,
} from '@0xintuition/protocol'- Add a new panel: extend
src/lib/protocol.ts, then add oneFormPanelto the relevant section component. - Change defaults: update
DEFAULT_CURVE_ID,DEFAULT_MIN_SHARES, orDEFAULT_MIN_ASSETSinsrc/lib/protocol.ts. - Support mainnet: add
intuitionMainnettosrc/config/wagmi.tsand continue usinggetMultiVaultAddressFromChainId()for address resolution. - Replace CSV batch inputs with richer UI: keep the protocol wrappers intact and swap only the section-level field collection.
- Ungate reads from wallet connection: move the
disabled={!isConnected}rule insrc/App.tsxto per-panel logic, but keep wallet-aware preview helpers onWriteConfig.
| Variable | Required | Description |
|---|---|---|
VITE_WALLETCONNECT_PROJECT_ID |
Yes | WalletConnect project ID used by RainbowKit / wagmi |
| Item | Value |
|---|---|
| Chain | Intuition Testnet |
| Chain ID | 13579 |
| Native Token | $tTRUST |
| RPC HTTP | https://testnet.rpc.intuition.systems/http |
| RPC WebSocket | wss://testnet.rpc.intuition.systems/ws |
| Explorer | https://testnet.explorer.intuition.systems |
| Hub | https://testnet.hub.intuition.systems |
| MultiVault Address | Resolve with getMultiVaultAddressFromChainId(13579) |
Claim 0.1 $tTRUST daily from the Intuition Testnet Hub. The hub also provides bridging and network tools.
| Item | Value |
|---|---|
| Chain | Intuition Mainnet |
| Chain ID | 1155 |
| Native Token | $TRUST |
| RPC HTTP | https://rpc.intuition.systems/http |
| RPC WebSocket | wss://rpc.intuition.systems/ws |
| Explorer | https://explorer.intuition.systems |
| Hub | https://hub.intuition.systems |
| MultiVault Address | Resolve with getMultiVaultAddressFromChainId(1155) |
Bridge $TRUST from Base Mainnet through the Intuition Hub. TRUST is available as an ERC-20 on Base at 0x6cd905dF2Ed214b22e0d48FF17CD4200C1C6d8A3.
Copy any of these prompts into Claude, Codex, or your AI agent of choice. Give it this README for context.
-
"Create an atom and immediately stake on it in a single flow." Right now creating and staking are separate forms. This combines them so you can do both in one step — great for understanding how the protocol pieces connect. Adds a new function + form panel.
-
"Add a network switcher so I can use this on Intuition Mainnet too." The template runs on testnet by default. This adds mainnet ($TRUST on chain 1155) alongside testnet ($tTRUST on chain 13579) with a toggle. Touches wagmi config, protocol, and section components. See the Mainnet section above for network details.
-
"Let me browse the read-only panels without connecting a wallet first." Currently everything requires a wallet connection. This makes the read panels (atom lookup, vault state, protocol config) available immediately so you can explore before connecting. Changes the gating logic in a few files.
-
"Add a panel that shows my recent transactions with links to the explorer." After creating atoms or making deposits, it'd be nice to see a running history of what you've done in this session with clickable links to the block explorer. Adds a new tab + context provider.
This template uses agentsync to maintain a single source of truth for AI agent rules across multiple tools.
.agents/
├── agentsync.toml ← config: which tools get symlinks
└── INSTRUCTIONS.md ← single source of truth for agent rules
CLAUDE.md → .agents/INSTRUCTIONS.md (Claude Code)
CODEX.md → .agents/INSTRUCTIONS.md (OpenAI Codex)
AGENTS.md → .agents/INSTRUCTIONS.md (Cursor)
To update agent rules: edit .agents/INSTRUCTIONS.md. All tools see the change immediately through symlinks.
After a fresh clone: run bun run agents:apply to recreate the symlinks. You can also run bun run agents:status to check their state.
- No server-side data queries, caching, or search.
- No authentication, user accounts, or saved history.
- No mainnet toggle or multi-network routing.
For those features, see the sibling repo: intuition-advanced-template.