{"id":31619313,"url":"https://github.com/multiversx/mx-template-dapp-solidjs","last_synced_at":"2026-07-18T12:32:00.846Z","repository":{"id":295989564,"uuid":"826138445","full_name":"multiversx/mx-template-dapp-solidjs","owner":"multiversx","description":"A template dApp showcasing the use of sdk-dapp-v3","archived":false,"fork":false,"pushed_at":"2026-07-02T13:16:15.000Z","size":4385,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-07-02T15:13:31.856Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multiversx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-09T06:46:17.000Z","updated_at":"2025-10-15T09:45:30.000Z","dependencies_parsed_at":"2025-07-17T17:29:05.669Z","dependency_job_id":"1898375e-06d1-40ed-8bfd-407f13f7babc","html_url":"https://github.com/multiversx/mx-template-dapp-solidjs","commit_stats":null,"previous_names":["multiversx/mx-solidjs-template-dapp","multiversx/mx-template-dapp-solidjs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/multiversx/mx-template-dapp-solidjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-template-dapp-solidjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-template-dapp-solidjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-template-dapp-solidjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-template-dapp-solidjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multiversx","download_url":"https://codeload.github.com/multiversx/mx-template-dapp-solidjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-template-dapp-solidjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35618185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-18T02:00:07.223Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-06T14:03:44.738Z","updated_at":"2026-07-18T12:32:00.841Z","avatar_url":"https://github.com/multiversx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MultiversX Template dApp (SolidJS)\n\nThe **MultiversX dApp Template** ported to [SolidJS](https://www.solidjs.com/) + TypeScript + [Vite](https://vitejs.dev/). It is a reference implementation of [@multiversx/sdk-dapp](https://www.npmjs.com/package/@multiversx/sdk-dapp) v5, demonstrating:\n\n- wallet authentication (browser extension, xPortal / WalletConnect, web wallet, Ledger)\n- transaction signing, sending, and tracking\n- smart-contract interaction (a Ping-Pong contract)\n- **how to bridge sdk-dapp's framework-agnostic store into SolidJS signals** (sdk-dapp ships React hooks, but its store works in any framework)\n\n\u003e **Looking for another framework?** The same dApp exists for React (TS and JS), Next.js, Vue, Angular, and React Native — see [Other templates](#other-templates).\n\n## Requirements\n\n- Node.js 24\n- pnpm 11 (the repo ships a `pnpm-lock.yaml` — use pnpm, not npm or yarn)\n\n\u003e pnpm blocks native postinstall build scripts by default; the allowlist (`keccak`, `protobufjs`, `esbuild`, ...) lives in `pnpm-workspace.yaml` under `allowBuilds`. If `pnpm install` exits non-zero over a new dependency's build script, add it there.\n\n## Getting started\n\n### 1. Install dependencies\n\n```bash\npnpm install\n```\n\n### 2. Start the dev server on the desired network\n\n```bash\npnpm start-devnet     # or start-testnet / start-mainnet\n```\n\nOpen [https://localhost:3001](https://localhost:3001) (note **https** — the dev server uses a self-signed certificate, because wallet providers only work on secure origins; accept the browser warning).\n\n### 3. Build for production\n\n```bash\npnpm build-devnet     # or build-testnet / build-mainnet\n```\n\nThe output goes to the `dist/` folder — deploy it to any static host.\n\n## Available scripts\n\n| Script | Description |\n| --- | --- |\n| `pnpm start-devnet` / `start-testnet` / `start-mainnet` | Copy the network config, then run the Vite dev server on `https://localhost:3001` |\n| `pnpm build-devnet` / `build-testnet` / `build-mainnet` | Copy the network config, then build to `dist/` |\n| `pnpm copy-devnet-config` (also `testnet` / `mainnet`) | Copy `src/config/config.\u003cnetwork\u003e.ts` over `src/config/index.ts` |\n| `pnpm dev` | Vite dev server with the currently active config |\n| `pnpm start` | Type-check (`tsc`), then dev server |\n| `pnpm start-no-tsc` | Dev server, skip type-check, force dep re-optimization |\n| `pnpm serve` | Preview the production build |\n| `pnpm lint` | ESLint with `--fix` over `src` |\n\nThere is no test runner configured in this template.\n\n## Network configuration\n\nThere is **no `.env` file**. The active network (devnet / testnet / mainnet) is selected at dev/build time by copying one of the per-network config files over the generated index:\n\n- `src/config/config.devnet.ts`, `config.testnet.ts`, `config.mainnet.ts` — per-network values (`API_URL`, `contractAddress`, `environment`)\n- `src/config/sharedConfig.ts` — values common to all networks (WalletConnect project ID, native auth flag, batch-transaction contracts)\n- `src/config/index.ts` — **generated** by the `copy-*-config` scripts; never edit it by hand, it is overwritten on every `start-*` / `build-*`\n\nThe `environment` exported by the active config is passed to sdk-dapp's `initApp` in `src/initConfig.ts`, so the copy mechanism is the single source of truth for the network.\n\n## Project structure\n\n```\nsrc/\n├── assets/          # images, icons\n├── components/      # shared presentational components\n├── config/          # per-network configs (see Network configuration)\n├── contracts/       # Ping-Pong contract ABI (loaded at runtime)\n├── helpers/         # signAndSendTransactions and other utilities\n├── hooks/           # useStore (the store → Solid signal bridge) + transaction hooks\n├── lib/             # SDK re-export layer — the only place with deep @multiversx/* imports\n├── localConstants/  # route names\n├── pages/           # Home, Dashboard, Disclaimer\n├── routes/          # route table consumed by App.tsx\n├── styles/          # Tailwind v4 styles\n├── types/           # shared TypeScript types\n├── wrappers/        # layout/auth wrappers\n├── initConfig.ts    # the InitAppType config passed to sdk-dapp's initApp\n└── index.tsx        # entry: awaits initApp(config), then renders the app\n```\n\n## How sdk-dapp is used\n\n1. **Bootstrap** — `src/index.tsx` awaits `initApp(config)` (config in `src/initConfig.ts`) before rendering; sdk-dapp must initialize its store and providers first.\n2. **SDK import layer** — app code never imports `@multiversx/sdk-*` directly; everything goes through `src/lib/` (`sdkCore`, `sdkDapp`, `sdkDappUI`, `sdkDappUtils`). Import from `'lib'`.\n3. **The Solid state bridge (the key concept)** — sdk-dapp ships React hooks, but its store is framework-agnostic. `src/hooks/useStore.ts` subscribes to the store and mirrors it into a Solid signal. Components combine it with the framework-agnostic selectors re-exported from `lib` (`accountSelector`, `networkSelector`, `getAccount`, ...):\n\n   ```ts\n   const store = useStore();\n   const network = networkSelector(store());\n   ```\n\n   Prefer this over the React `useGet*` hooks.\n4. **Login** — the connect button opens sdk-dapp's `UnlockPanelManager`, which lists all available providers.\n5. **Transactions** — `src/helpers/signAndSendTransactions.ts` is the single choke point: `getAccountProvider()` → `refreshAccount()` → `provider.signTransactions()` → `TransactionManager.send()` → `.track()`. Feature hooks like `src/hooks/transactions/useSendPingPongTransaction.ts` build the `Transaction` objects (raw, ABI factory, or service) and delegate to it.\n\n## Other templates\n\nThe same template dApp is implemented across several frameworks. If another stack suits your project better, start from one of these instead:\n\n| Template | Stack | Repository |\n| --- | --- | --- |\n| React (TypeScript) | React 18 · TypeScript · Vite | [mx-template-dapp](https://github.com/multiversx/mx-template-dapp) |\n| React (JavaScript) | React 19 · JSX · Vite | [mx-template-dapp-reactjs](https://github.com/multiversx/mx-template-dapp-reactjs) |\n| Next.js | Next.js 16 (App Router) · TypeScript | [mx-template-dapp-nextjs](https://github.com/multiversx/mx-template-dapp-nextjs) |\n| SolidJS **← this repo** | SolidJS · TypeScript · Vite | [mx-template-dapp-solidjs](https://github.com/multiversx/mx-template-dapp-solidjs) |\n| Vue | Vue 3 · TypeScript · Vite | [mx-template-dapp-vue](https://github.com/multiversx/mx-template-dapp-vue) |\n| Angular | Angular 20 · TypeScript | [mx-template-dapp-angular](https://github.com/multiversx/mx-template-dapp-angular) |\n| React Native | React Native | [mx-template-dapp-react-native](https://github.com/multiversx/mx-template-dapp-react-native) |\n\n## Links\n\n- [@multiversx/sdk-dapp on GitHub](https://github.com/multiversx/mx-sdk-dapp) · [on npm](https://www.npmjs.com/package/@multiversx/sdk-dapp)\n- [MultiversX developer docs](https://docs.multiversx.com/)\n- [SolidJS documentation](https://www.solidjs.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiversx%2Fmx-template-dapp-solidjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultiversx%2Fmx-template-dapp-solidjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiversx%2Fmx-template-dapp-solidjs/lists"}