{"_id":"@droplinked_inc/wallet-connection","_rev":"4-bac40b04754deb2c77dc818491512229","name":"@droplinked_inc/wallet-connection","dist-tags":{"latest":"0.4.1"},"versions":{"0.1.1":{"name":"@droplinked_inc/wallet-connection","version":"0.1.1","license":"MIT","_id":"@droplinked_inc/wallet-connection@0.1.1","maintainers":[{"name":"droplinked_inc","email":"ali@droplinked.com"}],"homepage":"https://github.com/droplinked/droplink-packages/tree/main/packages/wallet-connection#readme","bugs":{"url":"https://github.com/droplinked/droplink-packages/issues"},"dist":{"shasum":"f485a5ef29eaa85463ff4b139be48fc6fce05f31","tarball":"https://registry.npmjs.org/@droplinked_inc/wallet-connection/-/wallet-connection-0.1.1.tgz","fileCount":41,"integrity":"sha512-9UKOFK4Qis/4Qdni49WPsuOIV9+kYoUiy7lows6AFlcxci4eW1ADCFM3g4Xj4tg4op24SpHnr+QdY1NWW//MJQ==","signatures":[{"sig":"MEQCICNhHgy0hNEogmJ9iy54lC3hqLYMuAon8hY3sNF6b895AiAWZezoSxZSbRQnG7vtuwa5f0emZ4bLkWLvT6w22Xjmtg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":178248},"main":"./dist/index.js","type":"module","_from":"file:droplinked_inc-wallet-connection-0.1.1.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"lint":"eslint src --max-warnings=0","test":"jest","build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit -p tsconfig.json","test:coverage":"jest --coverage"},"_npmUser":{"name":"droplinked_inc","email":"ali@droplinked.com"},"_resolved":"/tmp/74d995be17b925897ba382937abb37d7/droplinked_inc-wallet-connection-0.1.1.tgz","_integrity":"sha512-9UKOFK4Qis/4Qdni49WPsuOIV9+kYoUiy7lows6AFlcxci4eW1ADCFM3g4Xj4tg4op24SpHnr+QdY1NWW//MJQ==","repository":{"url":"git+https://github.com/droplinked/droplink-packages.git","type":"git","directory":"packages/wallet-connection"},"_npmVersion":"10.9.7","description":"Wallet connection adapters for droplinked (MetaMask, Coinbase, WalletConnect, Phantom). Hardened recover+rewrite of the original @droplinked/wallet-connection.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","dependencies":{"zod":"^3.23.8","viem":"^2.21.0","@noble/ed25519":"^2.1.0"},"publishConfig":{"access":"public","provenance":false},"_hasShrinkwrap":false,"devDependencies":{"fast-check":"^3.22.0","typescript":"^5.6.0","@types/jest":"^29.5.12","@types/node":"^22.5.0"},"_npmOperationalInternal":{"tmp":"tmp/wallet-connection_0.1.1_1779168343362_0.9939510179115596","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@droplinked_inc/wallet-connection","version":"0.3.0","license":"MIT","_id":"@droplinked_inc/wallet-connection@0.3.0","maintainers":[{"name":"droplinked_inc","email":"ali@droplinked.com"}],"homepage":"https://github.com/droplinked/droplink-packages/tree/main/packages/wallet-connection#readme","bugs":{"url":"https://github.com/droplinked/droplink-packages/issues"},"dist":{"shasum":"a85241f41ec6509fb025a3f7654a5e7bc1af5e84","tarball":"https://registry.npmjs.org/@droplinked_inc/wallet-connection/-/wallet-connection-0.3.0.tgz","fileCount":53,"integrity":"sha512-bRVblpvsluFK7ly2OOybdAYf4GAfeI8kQtvfz3oJKT9Vhy8hBxKaxDMcE5jYIeE28djOgpC5kjMmFm021/5DNg==","signatures":[{"sig":"MEQCIGFESUoUXQMh90t1CkBfgb+9ppaYSzKSpsUfHRPPFTHCAiAWXtsTTaE1Mi5+okBzzoZeSMl/vdsbQsG2ZkxyY2r9xw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":206154},"main":"./dist/index.js","type":"module","_from":"file:droplinked_inc-wallet-connection-0.3.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"lint":"eslint src --max-warnings=0","test":"jest","build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.compat.json","test:coverage":"jest --coverage"},"_npmUser":{"name":"droplinked_inc","email":"ali@droplinked.com"},"_resolved":"/tmp/397eac0542685f8b1b8c046663e27375/droplinked_inc-wallet-connection-0.3.0.tgz","_integrity":"sha512-bRVblpvsluFK7ly2OOybdAYf4GAfeI8kQtvfz3oJKT9Vhy8hBxKaxDMcE5jYIeE28djOgpC5kjMmFm021/5DNg==","repository":{"url":"git+https://github.com/droplinked/droplink-packages.git","type":"git","directory":"packages/wallet-connection"},"_npmVersion":"10.9.7","description":"Wallet connection adapters for droplinked (MetaMask, Coinbase, WalletConnect, Phantom). Hardened recover+rewrite of the original @droplinked/wallet-connection.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","dependencies":{"zod":"^3.23.8","viem":"^2.21.0","@noble/ed25519":"^2.1.0"},"publishConfig":{"access":"public","provenance":false},"_hasShrinkwrap":false,"devDependencies":{"fast-check":"^3.22.0","typescript":"^5.6.0","@types/jest":"^29.5.12","@types/node":"^22.5.0"},"_npmOperationalInternal":{"tmp":"tmp/wallet-connection_0.3.0_1779173508588_0.4521435140005501","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@droplinked_inc/wallet-connection","version":"0.4.0","license":"MIT","_id":"@droplinked_inc/wallet-connection@0.4.0","maintainers":[{"name":"droplinked_inc","email":"ali@droplinked.com"}],"homepage":"https://github.com/droplinked/droplink-packages/tree/main/packages/wallet-connection#readme","bugs":{"url":"https://github.com/droplinked/droplink-packages/issues"},"dist":{"shasum":"f4e6955a192789fcd5a8a8507e3a518e600d2f90","tarball":"https://registry.npmjs.org/@droplinked_inc/wallet-connection/-/wallet-connection-0.4.0.tgz","fileCount":53,"integrity":"sha512-LibIcz8TDEXrJOnF7B9PbXq99MWo+8OCGv3n1nEQUdwo4WmsI6YdlczzLJeMBDrLnR7lnJWlvKR/uN0J4/voTw==","signatures":[{"sig":"MEUCIFJRWYV1zaUAF4eugrigI8trDT8feQX8Lc135YmmEptSAiEAnqQIMO4t8fHNWLS2Y+WA31e2aS8cra9NjF3jtictawk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":216986},"main":"./dist/index.js","type":"module","_from":"file:droplinked_inc-wallet-connection-0.4.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"lint":"eslint src --max-warnings=0","test":"jest","build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.compat.json","test:coverage":"jest --coverage"},"_npmUser":{"name":"droplinked_inc","email":"ali@droplinked.com"},"_resolved":"/tmp/97471811bbd1e01cd208d29715ffba6f/droplinked_inc-wallet-connection-0.4.0.tgz","_integrity":"sha512-LibIcz8TDEXrJOnF7B9PbXq99MWo+8OCGv3n1nEQUdwo4WmsI6YdlczzLJeMBDrLnR7lnJWlvKR/uN0J4/voTw==","repository":{"url":"git+https://github.com/droplinked/droplink-packages.git","type":"git","directory":"packages/wallet-connection"},"_npmVersion":"10.9.7","description":"Wallet connection adapters for droplinked (MetaMask, Coinbase, WalletConnect, Phantom). Hardened recover+rewrite of the original @droplinked/wallet-connection.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","dependencies":{"zod":"^3.23.8","viem":"^2.21.0","@noble/ed25519":"^2.1.0"},"publishConfig":{"access":"public","provenance":false},"_hasShrinkwrap":false,"devDependencies":{"fast-check":"^3.22.0","typescript":"^5.6.0","@types/jest":"^29.5.12","@types/node":"^22.5.0"},"_npmOperationalInternal":{"tmp":"tmp/wallet-connection_0.4.0_1779330277728_0.7592073848034562","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@droplinked_inc/wallet-connection","version":"0.4.1","description":"Wallet connection adapters for droplinked (MetaMask, Coinbase, WalletConnect, Phantom). Hardened recover+rewrite of the original @droplinked/wallet-connection.","license":"MIT","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"publishConfig":{"access":"public","provenance":false},"sideEffects":false,"dependencies":{"@noble/ed25519":"^2.1.0","viem":"^2.21.0","zod":"^3.23.8"},"devDependencies":{"@types/jest":"^29.5.12","@types/node":"^22.5.0","fast-check":"^3.22.0","typescript":"^5.6.0"},"repository":{"type":"git","url":"git+https://github.com/droplinked/droplink-packages.git","directory":"packages/wallet-connection"},"homepage":"https://github.com/droplinked/droplink-packages/tree/main/packages/wallet-connection#readme","bugs":{"url":"https://github.com/droplinked/droplink-packages/issues"},"engines":{"node":">=22.0.0"},"scripts":{"build":"tsc -p tsconfig.json","test":"jest","test:coverage":"jest --coverage","lint":"eslint src --max-warnings=0","typecheck":"tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.compat.json"},"_id":"@droplinked_inc/wallet-connection@0.4.1","_integrity":"sha512-YOFUcX/80Ca7/mCWHKqOfEXO7tUD/bu28mnC7XbeHIvlEFTZliNqN5HjxrotEXLDxQDkSbKS5xTL4Bj2MrHORg==","_resolved":"/tmp/830e61cad0a84c060fe72ce821cb213b/droplinked_inc-wallet-connection-0.4.1.tgz","_from":"file:droplinked_inc-wallet-connection-0.4.1.tgz","_nodeVersion":"22.23.1","_npmVersion":"11.19.0","dist":{"integrity":"sha512-YOFUcX/80Ca7/mCWHKqOfEXO7tUD/bu28mnC7XbeHIvlEFTZliNqN5HjxrotEXLDxQDkSbKS5xTL4Bj2MrHORg==","shasum":"8ab74454ccbc19c2d7026e94aef1bce61e4d2886","tarball":"https://registry.npmjs.org/@droplinked_inc/wallet-connection/-/wallet-connection-0.4.1.tgz","fileCount":53,"unpackedSize":217723,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCld4OLBMDD1vgH9KD6tMKMq7uaE+bPLSJtDnC7TnPabgIgNBL+nH9a6s5BTUQASfryUweW37WgI6SvV2WGhqcrpmE="}]},"_npmUser":{"name":"droplinked_inc","email":"ali@droplinked.com"},"directories":{},"maintainers":[{"name":"droplinked_inc","email":"ali@droplinked.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wallet-connection_0.4.1_1786016230061_0.701803919949604"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T05:25:43.283Z","modified":"2026-08-06T11:37:10.420Z","0.1.1":"2026-05-19T05:25:43.554Z","0.3.0":"2026-05-19T06:51:48.722Z","0.4.0":"2026-05-21T02:24:37.877Z","0.4.1":"2026-08-06T11:37:10.250Z"},"bugs":{"url":"https://github.com/droplinked/droplink-packages/issues"},"license":"MIT","homepage":"https://github.com/droplinked/droplink-packages/tree/main/packages/wallet-connection#readme","repository":{"type":"git","url":"git+https://github.com/droplinked/droplink-packages.git","directory":"packages/wallet-connection"},"description":"Wallet connection adapters for droplinked (MetaMask, Coinbase, WalletConnect, Phantom). Hardened recover+rewrite of the original @droplinked/wallet-connection.","maintainers":[{"name":"droplinked_inc","email":"ali@droplinked.com"}],"readme":"# @droplinked_inc/wallet-connection\n\n> Replaces `droplinked-wallet-connection`. See [MIGRATION.md](../../docs/MIGRATION.md) for the swap path.\n\nHardened wallet-connection primitives for droplinked: MetaMask, Coinbase\nWallet, and Phantom. EIP-712 typed-data login with chain + origin +\nnonce binding, zod-validated RPC boundaries, no `any`, no remote ABI\nfetches.\n\nThis package is a clean rewrite of the original\n`@droplinked/wallet-connection@1.0.1` (hostile-published by an external\nactor). See `THREAT_MODEL.md` for the threat scenarios this package\nmitigates and the test cases that exercise them.\n\n## Install\n\n```sh\npnpm add @droplinked_inc/wallet-connection\n```\n\nPeer-ish runtime deps:\n\n- `viem ^2.21`\n- `zod ^3.23`\n\nBoth are direct dependencies; you do not need to install them yourself.\n\n## Quick start — EVM login (MetaMask)\n\n```ts\nimport {\n  EvmConnector,\n  Chain,\n  Network,\n  verifyLoginSignature,\n  buildSession,\n  saveSession,\n} from '@droplinked_inc/wallet-connection';\n\nconst connector = new EvmConnector({\n  chain: Chain.ETH,\n  network: Network.MAINNET,\n  origin: window.location.origin,\n});\n\nconst { address, signature } = await connector.walletLogin();\n\n// Verify (server-side or client-side):\nawait verifyLoginSignature({\n  payload: /* the LoginPayload returned by your server */,\n  signature,\n  expectedAddress: address,\n  expectedChainId: 1,\n  expectedOrigin: window.location.origin,\n});\n\nsaveSession(\n  buildSession({\n    address,\n    chainId: 1,\n    origin: window.location.origin,\n    signature,\n    ttlSeconds: 60 * 60 * 8, // 8 hours\n  }),\n);\n```\n\n## Quick start — Phantom (Solana) login\n\n```ts\nimport { PhantomConnector, Network } from '@droplinked_inc/wallet-connection';\n\nconst connector = new PhantomConnector(Network.MAINNET);\nconst { address, signature } = await connector.walletLogin();\n```\n\n## ERC-20 transfer\n\n```ts\nconst txHash = await connector.paymentWithToken(\n  receiverAddress,\n  1000000n, // amount as bigint\n  tokenAddress,\n);\n```\n\nNote: this issues a direct `transfer`. There is **no** `approve` API\nexposed — drainer-style allowance flows are not reachable from this\npackage. See `THREAT_MODEL.md` §T5.\n\n## Custom checkout calldata\n\nThe droplinked v3 checkout contract is invoked via\n`submitRawTransaction()` with calldata produced by the droplinked\ncheckout API. The legacy direct ABI encoder is intentionally removed\n(see `THREAT_MODEL.md` §T7 — remote ABI/address fetch was a single\npoint of supply-chain compromise).\n\n```ts\nconst txHash = await connector.submitRawTransaction({\n  to: checkoutContractAddress,\n  data: serverProducedCalldata,\n  value: totalPriceWei,\n  gasLimit: 3_000_000n,\n});\n```\n\n## Security\n\n- All RPC responses are zod-validated. Wallets that return malformed\n  data cause a typed error, not silent corruption.\n- Login signatures are EIP-712 typed with chain + origin + nonce +\n  issuedAt + optional expirationTime.\n- `selectMetaMaskProvider()` and `selectCoinbaseProvider()` require the\n  wallet's own self-identification flag. There is no fallback to the\n  umbrella `window.ethereum`.\n- Nonces use `crypto.getRandomValues()` (256 bits). If Web Crypto is\n  unavailable the call throws — there is no `Math.random()` fallback.\n- Sessions default to `sessionStorage` (cleared on tab close), not\n  `localStorage`. They carry an explicit `expiresAt` that\n  `loadSession()` enforces.\n\nSee `THREAT_MODEL.md` for the full delta vs. the original v1.0.1 and\nthe tests that exercise each scenario.\n\n## Status\n\nInitial recover + harden. The original public API names are preserved\nwhere feasible; the following changes are deliberate and noted in\n`THREAT_MODEL.md`:\n\n- Chain/Network/ChainWallet are now string-valued enums (was implicit-\n  numeric).\n- `getNetworkProvider(chain, network, address, wallet)` is now\n  `getNetworkProvider({ chain, network, address, wallet, ... })`.\n- `EVMProvider` is now `EvmConnector`; `SolanaProvider` is now\n  `PhantomConnector` (constructor signatures changed accordingly).\n- `EVMPayment` (the free function) is removed; use\n  `EvmConnector.submitRawTransaction()`.\n- Error classes now extend `Error` (regression-fixes try/catch).\n\n## License\n\nMIT.\n","readmeFilename":"README.md"}