{"_id":"@bitshard.io/bitshard-wagmi-connector","_rev":"3-b44e3a8c46d9494d84b5994975042016","name":"@bitshard.io/bitshard-wagmi-connector","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@bitshard.io/bitshard-wagmi-connector","version":"0.1.0","keywords":["wagmi","connector","wallet","mpc","threshold-signatures","dkls","dkls23","bitshard","arbitrum","ethereum","web3"],"author":{"name":"bitshard.io"},"license":"MIT","_id":"@bitshard.io/bitshard-wagmi-connector@0.1.0","maintainers":[{"name":"bitshard_io","email":"dev@bitshard.io"}],"homepage":"https://bitshard.io","bugs":{"url":"https://github.com/bitshard-io/bitshard-wagmi-connector/issues"},"dist":{"shasum":"290d5ba257791443e09a9068e0448918f3ae9732","tarball":"https://registry.npmjs.org/@bitshard.io/bitshard-wagmi-connector/-/bitshard-wagmi-connector-0.1.0.tgz","fileCount":38,"integrity":"sha512-le6bML7TP4zPUNOA55w1CcNg2tbNw0h+u3l97pX0BQviVT9QF/f3HHQYNj5b79JyRPg5HIsOdm8jRam6OjvALg==","signatures":[{"sig":"MEQCICxIArx0vimJwcFgbghRpvyAIBaCyrJYUAtOi8zEqa8VAiBnvuJEd8UDqOnNChy7g49PrOovfM7iUoV5sZ/z7mOVIg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":89563},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"gitHead":"242ecf17cde40ad7836de45de13e0f47672511d4","scripts":{"dev":"tsc -p tsconfig.json --watch","test":"jest","build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"bitshard_io","email":"dev@bitshard.io"},"repository":{"url":"git+https://github.com/bitshard-io/bitshard-wagmi-connector.git","type":"git"},"_npmVersion":"10.9.4","description":"Wagmi connector for the BitShard MPC wallet. Lets dApps connect to a non-custodial 2-of-3 threshold wallet via a hosted popup, with no per-dApp browser extension.","directories":{},"_nodeVersion":"22.22.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","viem":"^2.21.0","ts-jest":"^29.1.1","typescript":"^5.3.3","@types/jest":"^29.5.11","@types/node":"^20.10.5","@wagmi/core":"^2.13.0","jest-environment-jsdom":"^29.7.0"},"peerDependencies":{"viem":"^2.0.0","@wagmi/core":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/bitshard-wagmi-connector_0.1.0_1777847991599_0.7495203388882266","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@bitshard.io/bitshard-wagmi-connector","version":"0.2.0","keywords":["wagmi","connector","wallet","mpc","threshold-signatures","dkls","dkls23","bitshard","arbitrum","ethereum","web3"],"author":{"name":"bitshard.io"},"license":"MIT","_id":"@bitshard.io/bitshard-wagmi-connector@0.2.0","maintainers":[{"name":"bitshard_io","email":"dev@bitshard.io"}],"homepage":"https://bitshard.io","bugs":{"url":"https://github.com/bitshard-io/bitshard-wagmi-connector/issues"},"dist":{"shasum":"b8bf9a56727d29ff91be548ca4637f8c05203a4a","tarball":"https://registry.npmjs.org/@bitshard.io/bitshard-wagmi-connector/-/bitshard-wagmi-connector-0.2.0.tgz","fileCount":38,"integrity":"sha512-FyMKhgn/F8qnKWp6pMLDRBrMFcjVdWtUU4H0+Uvwc81p3oADuJjxW5djtHUHevwvxG1NDajTSJAmSRYK2R5vbg==","signatures":[{"sig":"MEUCICdcsOE6C1uhgI+2TiRdDxlkZVGOvijf8f9K5ZzF02NyAiEAup4aNOZTTMtV/cldverGZ5RfWmk6a2nVa0tDgKX8qDE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":96190},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"gitHead":"242ecf17cde40ad7836de45de13e0f47672511d4","scripts":{"dev":"tsc -p tsconfig.json --watch","test":"jest","build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"bitshard_io","email":"dev@bitshard.io"},"repository":{"url":"git+https://github.com/bitshard-io/bitshard-wagmi-connector.git","type":"git"},"_npmVersion":"10.9.4","description":"Wagmi connector for the BitShard MPC wallet. Lets dApps connect to a non-custodial 2-of-3 threshold wallet via a hosted popup, with no per-dApp browser extension.","directories":{},"_nodeVersion":"22.22.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","viem":"^2.21.0","ts-jest":"^29.1.1","typescript":"^5.3.3","@types/jest":"^29.5.11","@types/node":"^20.10.5","@wagmi/core":"^2.13.0","jest-environment-jsdom":"^29.7.0"},"peerDependencies":{"viem":"^2.0.0","@wagmi/core":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/bitshard-wagmi-connector_0.2.0_1778362198423_0.27133933974222435","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@bitshard.io/bitshard-wagmi-connector","version":"0.2.1","description":"Wagmi connector for the BitShard MPC wallet. Lets dApps connect to a non-custodial 2-of-3 threshold wallet via a hosted popup, with no per-dApp browser extension.","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","dev":"tsc -p tsconfig.json --watch","test":"jest","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"keywords":["wagmi","connector","wallet","mpc","threshold-signatures","dkls","dkls23","bitshard","arbitrum","ethereum","web3"],"author":{"name":"bitshard.io"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bitshard-io/bitshard-wagmi-connector.git"},"homepage":"https://bitshard.io","bugs":{"url":"https://github.com/bitshard-io/bitshard-wagmi-connector/issues"},"publishConfig":{"access":"public"},"peerDependencies":{"@wagmi/core":"^2.0.0","viem":"^2.0.0"},"devDependencies":{"@types/jest":"^29.5.11","@types/node":"^20.10.5","@wagmi/core":"^2.13.0","jest":"^29.7.0","jest-environment-jsdom":"^29.7.0","ts-jest":"^29.1.1","typescript":"^5.3.3","viem":"^2.21.0"},"engines":{"node":">=18"},"_id":"@bitshard.io/bitshard-wagmi-connector@0.2.1","gitHead":"e29aa42cce96231bc4b15dd30a08a604810dcf5b","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-OmcX9/gjuGzfpEnHQv50Lh9y2dHN0GuT45tOP7szQTRX7Gii87X9UPfNVdVw/ekxf+IzzMlMfAUePv/eXa1GvQ==","shasum":"1ffebf86d0ff594c4c8c8ea6b8001adfc49ae405","tarball":"https://registry.npmjs.org/@bitshard.io/bitshard-wagmi-connector/-/bitshard-wagmi-connector-0.2.1.tgz","fileCount":38,"unpackedSize":99874,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAQT/Zk4nBvlV44C6iKtal7AXv4CS0nAuhqHIfJTQaanAiAGs7gve1mz1TSngJTCHmRY0su3r0yoyiKAF9CIlndazA=="}]},"_npmUser":{"name":"bitshard_io","email":"dev@bitshard.io"},"directories":{},"maintainers":[{"name":"bitshard_io","email":"dev@bitshard.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bitshard-wagmi-connector_0.2.1_1778363459707_0.24198647627326553"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-03T22:39:51.498Z","modified":"2026-05-09T21:50:59.972Z","0.1.0":"2026-05-03T22:39:51.740Z","0.2.0":"2026-05-09T21:29:58.562Z","0.2.1":"2026-05-09T21:50:59.855Z"},"bugs":{"url":"https://github.com/bitshard-io/bitshard-wagmi-connector/issues"},"author":{"name":"bitshard.io"},"license":"MIT","homepage":"https://bitshard.io","keywords":["wagmi","connector","wallet","mpc","threshold-signatures","dkls","dkls23","bitshard","arbitrum","ethereum","web3"],"repository":{"type":"git","url":"git+https://github.com/bitshard-io/bitshard-wagmi-connector.git"},"description":"Wagmi connector for the BitShard MPC wallet. Lets dApps connect to a non-custodial 2-of-3 threshold wallet via a hosted popup, with no per-dApp browser extension.","maintainers":[{"name":"bitshard_io","email":"dev@bitshard.io"}],"readme":"# @bitshard.io/bitshard-wagmi-connector\n\n[![npm version](https://img.shields.io/npm/v/@bitshard.io/bitshard-wagmi-connector.svg)](https://www.npmjs.com/package/@bitshard.io/bitshard-wagmi-connector)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)\n\nWagmi connector for the [BitShard](https://bitshard.io) MPC wallet.\n\nBitShard is a non-custodial wallet that uses 2-of-3 threshold signatures: the user's shares live on their mobile app and browser extension, and a third share lives on the BitShard server. This connector lets any wagmi-powered dApp connect to a BitShard wallet without the user installing any browser extension for the dApp itself — authentication and signature approval happen in a popup to `wallet.bitshard.io`.\n\n## Install\n\n```bash\nnpm install @bitshard.io/bitshard-wagmi-connector @wagmi/core viem\n```\n\nPeer dependencies: `@wagmi/core ^2`, `viem ^2`.\n\n## Usage\n\n```ts\nimport { createConfig, http } from '@wagmi/core';\nimport { arbitrumSepolia } from '@wagmi/core/chains';\nimport { bitshard } from '@bitshard.io/bitshard-wagmi-connector';\n\nexport const config = createConfig({\n  chains: [arbitrumSepolia],\n  connectors: [\n    bitshard({\n      appUrl: 'https://wallet.bitshard.io'\n    })\n  ],\n  transports: {\n    [arbitrumSepolia.id]: http()\n  }\n});\n```\n\n### With React\n\n```tsx\nimport { WagmiProvider, useAccount, useConnect, useSignMessage } from 'wagmi';\n\nfunction ConnectButton() {\n  const { connect, connectors } = useConnect();\n  const bitshardConnector = connectors.find((c) => c.id === 'bitshard');\n  return <button onClick={() => connect({ connector: bitshardConnector! })}>Connect BitShard</button>;\n}\n```\n\n## Parameters\n\n### `appUrl` (required)\n\n`string` — Origin of the BitShard wallet app (for example, `https://wallet.bitshard.io`). The connector opens a popup at `${appUrl}/connector?action=...` to handle authentication and signature approval.\n\n### `chains`\n\n`readonly Chain[]` — Chains supported by this connector. Defaults to Arbitrum One, Nova, and Sepolia.\n\n### `popupTimeoutMs`\n\n`number` — How long to wait for the popup to return a response before rejecting. Defaults to `300_000` (5 minutes).\n\n### `storagePrefix`\n\n`string` — LocalStorage prefix for persisted session state. Defaults to `'bitshard.wagmi'`.\n\n## Architecture\n\nThe connector is architecturally a thin EIP-1193 popup proxy. It does not run DKLS, doesn't generate or hold keyshares, and never sees private material. All MPC heavy lifting happens inside the BitShard popup window (`/connector` page on the wallet origin), the BitShard backend, the mobile app, and the browser extension.\n\nThat's why the only runtime peers are `@wagmi/core` and `viem` — no DKLS WASM, no `ws`, no ethers — keeping the dApp bundle small and the trust boundary obvious.\n\n## How it works\n\n1. `connect()` → popup opens at `${appUrl}/connector?action=connect`. The user logs in through Keycloak on the BitShard wallet domain, and the bridge page `postMessage`s `{ type: 'bitshard:connected', address, chainId }` back to the dApp.\n2. `personal_sign` / `eth_signTypedData_v4` → popup opens at `${appUrl}/connector?action=sign`. The BitShard app runs the existing 2-of-3 MPC signing ceremony (user approves on mobile + browser extension), then posts back `{ type: 'bitshard:signed', signature }`.\n3. `eth_sendTransaction` → popup opens at `${appUrl}/connector?action=tx`. Same MPC ceremony, then broadcast, then posts back `{ type: 'bitshard:tx', hash }`.\n4. Read-only methods (`eth_call`, `eth_getBalance`, etc.) are forwarded to a `viem` public client — no popup needed.\n\nSession state (address, chainId, expiry) is persisted in `localStorage`. Wagmi's `reconnect` hydrates silently from storage without re-opening the popup.\n\n## Development\n\n```bash\nnpm install\nnpm run build       # tsc -> dist/\nnpm test            # jest (jsdom)\nnpm run typecheck\n```\n\n## Publishing\n\nMaintainers only. Bump the version in `package.json`, then:\n\n```bash\ngit commit -am \"<version>\"\ngit tag v<version>\ngit push origin main\ngit push origin v<version>\n\nnpm publish --access public\n```\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n","readmeFilename":"README.md"}