<!-- TokenOS docs · Building apps · Markdown mirror of https://tokenos.ai/docs/web3-config · HTML: https://tokenos.ai/docs/web3-config · index: https://tokenos.ai/llms.txt -->

# Live Web3 Config

The modal that appears before every first build decides whether your app is **real** or a **demo**. Fill it in and the generated app ships with real wallet connect, balances, prices and transaction handlers wired to the chain you chose. Skip it and you get a UI-only build with a yellow Demo banner and blocked transactions.

> **Warning — “My app shows fake data / nothing works”**
> Previews and deployed apps run **identical code** — hosting does not make things real. An app is live when (1) it was built with Live Web3 Config and (2) its contract is deployed on the network the config points at. Metrics that cannot be read on chain yet carry a yellow *Simulated* badge by design.

### Fields

| Field | Options / format | What it drives |
| --- | --- | --- |
| Chain | solana · evm | Which runtime is injected (Solana web3.js + wallet adapter, or EVM with injected wallets). |
| EVM chain | base · robinhood | Chain id, RPC and explorer (Base 8453 / Base Sepolia 84532; Robinhood Chain 4663 / testnet 46630). |
| Network | devnet / testnet · mainnet | RPC endpoint and explorer base. Choose a test network first; rebuild on mainnet when ready. |
| Admin wallet | address | The only wallet that sees admin pages (isAdmin). Defaults to the connected wallet. |
| Payments wallet | address | Where in-app payments land. Can be the same as the admin wallet. |
| Creator share | 0 – 30 %, step 0.5 (default 5 %) | Stored as creator_share_bps; the runtime splits every payment between the payments wallet and the platform fee automatically. |
| Token | No token · Use existing (mint / address) · Launch new (Pump.fun, Solana only) | Bakes the token into the app (TOKENS map, balances, transfers). The in-build launch requires the issuer acknowledgement (Terms §12.2). |

### What the generated app receives

`config.js` is written at build time and must not be edited by hand (it is a protected runtime file):

**config.js (Solana mainnet example)**

```js
export const CONFIG = {
  live: true,
  chain: "solana",
  network: "mainnet",
  rpcUrl: "https://tokenos.ai/api/solana-rpc",   // allow-listed proxy — never a keyed RPC
  adminWallet: "9rMG…ZMd",
  platformWallet: "<set server-side>",            // TokenOS fee destination
  platformFeeBps: 300,
  creatorShareBps: 500,
  revenueWallet: "<your payments wallet>",
  tokenMint: null,
};
```

For EVM builds the object also carries `evmChain`, `chainId`, `chainIdHex`, `chainName`, `explorerBase` and `addChainParams` (ready for `wallet_addEthereumChain`).

### The runtime: `lib/web3.js`

Hand-tested, zero-LLM-token JavaScript injected into every live build. Pages import from it instead of talking to RPC directly.

| Helper | Does |  |  |
| --- | --- | --- | --- |
| `pay(amount, memo?)` | Sends a payment and performs the platform-fee + creator-share split in the same flow; resolves with the signature and explorer link. |  |  |
| [object Object][object Object] | Native and token transfers with txStatus states (idle → signing → confirming → confirmed / failed). |  |  |
| `contractAction(name, args)` | Calls the deployed program / contract recorded by Deploy Contract. |  |  |
| `getBalance(address)` | `getTokenBalance` | `getWalletHoldings` | Real reads through the RPC proxy. |
| `getLivePrices()` | `getPriceDetails()` | `TOKENS` | Live market prices and the token map for the app. |
| `isAdmin(address)` | True only for the configured admin wallet — gate admin UI on it. |  |  |
| `explorerTx(sig)` | `explorerAddress(addr)` | Correct explorer links per chain and network. |  |

Wallet access comes from `hooks/useWallet.js` and `lib/walletBridge.js`: inside the IDE preview they talk to your real wallet through the consent-gated bridge; on a hosted app they talk to the browser's wallet extension directly. Pages always receive `wallet` as an **address string**.

### Demo mode

- A yellow “Demo Mode” banner at the bottom of every page.
- Transaction handlers are blocked with a friendly “UI demo build — rebuild with Live Web3 config” message.
- Reads still work where possible; everything else is clearly labelled Simulated.
- To make the app real, rebuild it and click “⚡ Build with Live Web3” instead of Skip.

### Changing the config later

Network, wallets and token are baked at build time. Use the Project Config action in the workspace to change them and rebuild — for example after deploying to mainnet, set Network to mainnet so RPC endpoints follow. The [Launch Checklist](https://tokenos.ai/docs/go-live) shows whether a project has a live config and where it has been deployed.

---

*Building apps · TokenOS documentation. Canonical page: https://tokenos.ai/docs/web3-config. All docs as Markdown: https://tokenos.ai/llms.txt. Payments on TokenOS are for metered usage only; nothing on this page is investment advice or a promise of income.*
