{"id":29608027,"url":"https://github.com/kheopskit/kheopskit","last_synced_at":"2026-02-08T09:12:03.287Z","repository":{"id":296864866,"uuid":"994772067","full_name":"kheopskit/kheopskit","owner":"kheopskit","description":"Library for connecting dapps to multiple platforms \u0026 wallets","archived":false,"fork":false,"pushed_at":"2025-06-27T12:43:25.000Z","size":579,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-27T12:58:34.300Z","etag":null,"topics":["ethereum","polkadot","wallets"],"latest_commit_sha":null,"homepage":"","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/kheopskit.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}},"created_at":"2025-06-02T13:07:12.000Z","updated_at":"2025-06-27T12:42:46.000Z","dependencies_parsed_at":"2025-06-03T02:54:20.859Z","dependency_job_id":null,"html_url":"https://github.com/kheopskit/kheopskit","commit_stats":null,"previous_names":["kheopskit/kheopskit"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/kheopskit/kheopskit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kheopskit%2Fkheopskit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kheopskit%2Fkheopskit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kheopskit%2Fkheopskit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kheopskit%2Fkheopskit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kheopskit","download_url":"https://codeload.github.com/kheopskit/kheopskit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kheopskit%2Fkheopskit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266180412,"owners_count":23888743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ethereum","polkadot","wallets"],"created_at":"2025-07-20T19:01:37.879Z","updated_at":"2026-02-08T09:12:03.277Z","avatar_url":"https://github.com/kheopskit.png","language":"TypeScript","readme":"# Kheopskit\n\nKheopskit is a library designed to simplify the development of Polkadot DApps. It provides tools to:\n\n- List all installed wallets and connect/disconnect them.\n- List all accounts from those wallets.\n- Support both Polkadot and Ethereum wallets.\n- Handle identical accounts injected by multiple wallets.\n\nTry it on the [interactive playground](https://Kheopskit.pages.dev/)\n\n## Features\n\n- **Multi-wallet support**: Easily interact with both Polkadot and Ethereum wallets.\n- **Account management**: Manage accounts from all connected wallets in a single list.\n- **Modern tech stack**: Designed for use with polkadot-api (PAPI) and viem.\n\n---\n\n## Installation\n\nInstall the required packages using `pnpm`:\n\n```bash\npnpm add @kheopskit/core @kheopskit/react\n```\n\n---\n\n## Usage\n\n### With React\n\n1. Import the required packages.\n2. Wrap your app with `KheopskitProvider`.\n3. Use the `useWallets` hook to access wallets and accounts.\n\n```tsx\nimport React from \"react\";\nimport { KheopskitProvider, useWallets } from \"@kheopskit/react\";\n\nconst App = () =\u003e {\n  const { wallets, accounts } = useWallets();\n\n  return (\n    \u003cdiv\u003e\n      \u003ch1\u003eWallets\u003c/h1\u003e\n      {wallets.map((wallet) =\u003e (\n        \u003cdiv key={wallet.id}\u003e\n          \u003cdiv\u003e\n            [{wallet.platform}] {wallet.name}\n          \u003c/div\u003e\n          {wallet.isConnected ? (\n            \u003cbutton onClick={wallet.disconnect}\u003eDisconnect\u003c/button\u003e\n          ) : (\n            \u003cbutton onClick={wallet.connect}\u003eConnect\u003c/button\u003e\n          )}\n        \u003c/div\u003e\n      ))}\n\n      \u003ch1\u003eAccounts\u003c/h1\u003e\n      {accounts.map((account) =\u003e (\n        \u003cdiv key={account.address}\u003e\n          \u003cp\u003e\n            [{wallet.platform}] {account.name} (account.) - {account.address}\n          \u003c/p\u003e\n        \u003c/div\u003e\n      ))}\n    \u003c/div\u003e\n  );\n};\n\nconst config = {\n  platforms: [\"polkadot\", \"ethereum\"],\n  autoReconnect: true,\n};\n\nconst Root = () =\u003e (\n  \u003cKheopskitProvider config={config}\u003e\n    \u003cApp /\u003e\n  \u003c/KheopskitProvider\u003e\n);\n\nexport default Root;\n```\n\n### With Vanilla JavaScript and RxJS\n\n1. Instantiate a Kheopskit observable with `getKheopskit$(config)`.\n2. Subscribe to the observable to access wallets and accounts.\n\n```javascript\nimport { getKheopskit$ } from \"@kheopskit/core\";\n\nconst config = {\n  platforms: [\"polkadot\", \"ethereum\"],\n  autoReconnect: true,\n};\nconst kheopskit$ = getKheopskit$(config);\n\nkheopskit$.subscribe(({ wallets, accounts }) =\u003e {\n  console.log(\"Wallets:\", wallets);\n  console.log(\"Accounts:\", accounts);\n});\n```\n\n### Server-Side Rendering (SSR)\n\nKheopskit supports SSR with frameworks like Next.js and TanStack Start. Pass the `ssrCookies` prop to enable cookie-based storage that works on the server.\n\nWhen you pass `ssrCookies`:\n- Storage switches from localStorage to cookies\n- Server can read initial state from request headers\n- No hydration mismatch between server and client\n\n#### Next.js (App Router)\n\n```tsx\n// app/layout.tsx\nimport { cookies } from \"next/headers\";\nimport { App } from \"./app\";\n\nconst config = { platforms: [\"polkadot\", \"ethereum\"], autoReconnect: true };\n\nexport default async function RootLayout({ children }: { children: React.ReactNode }) {\n  const cookieStore = await cookies();\n  const ssrCookies = cookieStore.toString();\n\n  return (\n    \u003chtml\u003e\n      \u003cbody\u003e\n        \u003cKheopskitProvider config={config} ssrCookies={ssrCookies}\u003e\n          {children}\n        \u003c/KheopskitProvider\u003e\n      \u003c/body\u003e\n    \u003c/html\u003e\n  );\n}\n```\n\n#### TanStack Start\n\n```tsx\n// routes/__root.tsx\nimport { createRootRoute, Outlet } from \"@tanstack/react-router\";\nimport { createServerFn, Meta, Scripts } from \"@tanstack/start\";\nimport { getRequest } from \"@tanstack/start/server\";\nimport { KheopskitProvider } from \"@kheopskit/react\";\n\nconst config = { platforms: [\"polkadot\", \"ethereum\"], autoReconnect: true };\n\nconst getSSRCookies = createServerFn({ method: \"GET\" }).handler(async () =\u003e {\n  const request = getRequest();\n  return request?.headers.get(\"cookie\") ?? undefined;\n});\n\nexport const Route = createRootRoute({\n  loader: async () =\u003e ({ ssrCookies: await getSSRCookies() }),\n  component: RootComponent,\n});\n\nfunction RootComponent() {\n  const { ssrCookies } = Route.useLoaderData();\n  return (\n    \u003chtml\u003e\n      \u003chead\u003e\u003cMeta /\u003e\u003c/head\u003e\n      \u003cbody\u003e\n        \u003cKheopskitProvider config={config} ssrCookies={ssrCookies}\u003e\n          \u003cOutlet /\u003e\n        \u003c/KheopskitProvider\u003e\n        \u003cScripts /\u003e\n      \u003c/body\u003e\n    \u003c/html\u003e\n  );\n}\n```\n\n#### SSR Considerations\n\n| Feature | Client-Only | SSR (with `ssrCookies`) |\n|---------|-------------|-------------------------|\n| Storage | localStorage | Cookies |\n| Server access | ❌ | ✅ |\n| Hydration match | ⚠️ Flash possible | ✅ No flash |\n| Size limit | ~5MB | ~4KB |\n| Cross-tab sync | `storage` event | BroadcastChannel |\n\n**Cookie attributes**: Kheopskit uses `SameSite=Lax`, `Secure` (on HTTPS), `path=/`, and 1-year expiry.\n\n**Cookie size limit (compact format)**: Cookie storage uses a compact JSON schema to stay under the ~4KB limit. As a rule of thumb, with 6 connected wallets you can fit about 30-40 accounts when most accounts do not include a name. If many accounts have names, expect closer to 25-30. When the cookie grows too large, browsers may reject it.\n\n---\n\n## Roadmap\n\n- [ ] Initial release with injected accounts support\n- [ ] Support for WalletConnect\n- [ ] UI components\n- [ ] Documentation\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Multisig Wallets"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkheopskit%2Fkheopskit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkheopskit%2Fkheopskit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkheopskit%2Fkheopskit/lists"}