{"_id":"@abstract-foundation/wallet-sdk","name":"@abstract-foundation/wallet-sdk","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@abstract-foundation/wallet-sdk","description":"Abstract Wallet SDK — framework-agnostic core for embedding the Abstract Global Wallet on third-party origins via iframe (with popup fallback). Origin-validated postMessage transport, hardened iframe sandboxing, IntersectionObserver-v2-aware visibility ch","version":"0.0.1","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Abstract-Foundation/abstract-packages.git","directory":"packages/wallet-sdk"},"bugs":{"url":"https://github.com/Abstract-Foundation/abstract-packages/issues"},"homepage":"https://github.com/Abstract-Foundation/abstract-packages/tree/main/packages/wallet-sdk","main":"./dist/cjs/exports/index.js","module":"./dist/esm/exports/index.js","types":"./dist/types/exports/index.d.ts","typings":"./dist/types/exports/index.d.ts","exports":{".":{"types":"./dist/types/exports/index.d.ts","import":"./dist/esm/exports/index.js","require":"./dist/cjs/exports/index.js"},"./core":{"types":"./dist/types/exports/core.d.ts","import":"./dist/esm/exports/core.js","require":"./dist/cjs/exports/core.js"},"./package.json":"./package.json"},"typesVersions":{"*":{"core":["dist/types/exports/core.d.ts"]}},"publishConfig":{"access":"public"},"peerDependencies":{"typescript":">=5.0.4","viem":"^2.37.0"},"peerDependenciesMeta":{"typescript":{"optional":true}},"devDependencies":{"@types/node":"^22.18.1","jsdom":"^25.0.1","typescript":"^5.8.2","viem":"^2.46.2","vitest":"^3.2.4"},"keywords":["abstract","abstract-global-wallet","agw","wallet","iframe","embedded-wallet","eip-1193","ethereum","web3","sdk"],"scripts":{"test":"vitest run -c ./test/vitest.config.ts","build":"pnpm run clean && pnpm run build:esm+types && pnpm run build:cjs","build:esm+types":"tsc --outDir ./dist/esm --declaration --declarationMap --declarationDir ./dist/types && printf '{\"type\":\"module\"}' > ./dist/esm/package.json","build:cjs":"tsc -p tsconfig.cjs.json && printf '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json","clean":"rm -rf dist tsconfig.tsbuildinfo","typecheck":"tsc --noEmit","test:build":"publint && attw --pack --ignore-rules false-cjs"},"_id":"@abstract-foundation/wallet-sdk@0.0.1","_integrity":"sha512-nK6CIhLR4A7tlbzs7t4dNtPFOnm/506yxl6TDMGMLA/KUcl50qEBT/CJ61bRMUvz2swyBtV5hT/1r2sUHg46RA==","_resolved":"/private/var/folders/r7/ryy594w50qqcdxt55s9qpp7r0000gn/T/e77a4a56514c73a27153cb1ef0975611/abstract-foundation-wallet-sdk-0.0.1.tgz","_from":"file:abstract-foundation-wallet-sdk-0.0.1.tgz","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-nK6CIhLR4A7tlbzs7t4dNtPFOnm/506yxl6TDMGMLA/KUcl50qEBT/CJ61bRMUvz2swyBtV5hT/1r2sUHg46RA==","shasum":"aed06a1088fbe1d5c021e04a878cf0f0283ddddc","tarball":"https://registry.npmjs.org/@abstract-foundation/wallet-sdk/-/wallet-sdk-0.0.1.tgz","fileCount":55,"unpackedSize":503152,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDqxzJ3FAvbi4KHgOkt7QcPcpSuzfuYjgvi5cuEDO5CoAiAe5Ujxni1kwY82+01J5w0T5fx48JU5961qz4ZxXZA8kg=="}]},"_npmUser":{"name":"coffeexcoin","email":"coffee@cubelabs.xyz"},"directories":{},"maintainers":[{"name":"cygaardev","email":"t@cubelabs.xyz"},{"name":"coffeexcoin","email":"coffee@cubelabs.xyz"},{"name":"jarrodwatts","email":"jarrodwatts16@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wallet-sdk_0.0.1_1778207120334_0.6217937914912541"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-08T02:25:20.218Z","0.0.1":"2026-05-08T02:25:20.471Z","modified":"2026-05-08T02:25:20.765Z"},"maintainers":[{"name":"cygaardev","email":"t@cubelabs.xyz"},{"name":"coffeexcoin","email":"coffee@cubelabs.xyz"},{"name":"jarrodwatts","email":"jarrodwatts16@gmail.com"}],"description":"Abstract Wallet SDK — framework-agnostic core for embedding the Abstract Global Wallet on third-party origins via iframe (with popup fallback). Origin-validated postMessage transport, hardened iframe sandboxing, IntersectionObserver-v2-aware visibility ch","homepage":"https://github.com/Abstract-Foundation/abstract-packages/tree/main/packages/wallet-sdk","keywords":["abstract","abstract-global-wallet","agw","wallet","iframe","embedded-wallet","eip-1193","ethereum","web3","sdk"],"repository":{"type":"git","url":"git+https://github.com/Abstract-Foundation/abstract-packages.git","directory":"packages/wallet-sdk"},"bugs":{"url":"https://github.com/Abstract-Foundation/abstract-packages/issues"},"license":"MIT","readme":"# @abstract-foundation/wallet-sdk\n\nFramework-agnostic SDK for embedding the Abstract Global Wallet on third-party\norigins via iframe (with popup fallback).\n\nPorts the security-relevant pieces of [Porto](https://github.com/ithacaxyz/porto)\nto the Abstract stack: origin-validated `postMessage` transport, hardened\niframe sandboxing, IntersectionObserver-v2-aware visibility checks (the\nclickjacking primitive lives in the wallet host), runtime-driven popup\nfallback over the messenger, and an EIP-1193 provider that proxies through\nto the wallet origin.\n\n> Status: **early**. The dApp-side core is in place; Web Components\n> (`/elements`) and React wrappers (`/react`) ship in follow-up releases.\n\n## Install\n\n```bash\npnpm add @abstract-foundation/wallet-sdk viem\n```\n\n## Usage\n\n```ts\nimport { createWallet } from '@abstract-foundation/wallet-sdk';\n\nconst wallet = createWallet({\n  host: 'https://wallet.abs.xyz',\n  chainId: 2741,\n  // optional\n  dialog: 'auto',  // 'auto' | 'iframe' | 'popup'\n});\n\n// EIP-1193 — pass straight to wagmi/viem/ethers\nconst accounts = await wallet.provider.request({\n  method: 'eth_requestAccounts',\n});\n```\n\n## Mode selection\n\n`'auto'` (default) starts in iframe mode and transparently falls back to a\npopup when:\n\n- Parent origin is HTTP (HTTPS is required for the iframe transport).\n- IntersectionObserver v2 (`isVisible`) is unsupported AND the parent host\n  is not on the wallet host's trusted-host allowlist.\n- The wallet host explicitly requests a switch via the messenger\n  (`__internal { type: 'switch', mode: 'popup' }`). The host uses this\n  hook for cases the parent SDK can't predict — for example, WebAuthn\n  credential creation on Safari (which Safari blocks in cross-origin\n  iframes) if a flow ever required it.\n\n### A note on WebAuthn / passkeys\n\nAGW does not use WebAuthn for wallet signing or account creation. Privy\npasskey enrollment happens in the main Abstract portal app under account\nmanagement — never inside the iframed wallet — so the SDK does not\npre-emptively force Safari users into popup mode for `wallet_connect` or\n`eth_requestAccounts`.\n\nReturning users with passkeys log in via `navigator.credentials.get()`,\nwhich works in cross-origin iframes when the `publickey-credentials-get`\npermission is granted (set automatically by `Dialog.iframe()`).\n\n## Iframe hardening\n\nWhen the iframe path is chosen, the iframe is mounted inside a top-layer\n`<dialog>` with:\n\n```\nsandbox=\"allow-forms allow-scripts allow-same-origin\n         allow-popups allow-popups-to-escape-sandbox\"\nallow=\"payment;\n       publickey-credentials-get   <walletOrigin>;\n       publickey-credentials-create <walletOrigin>;\n       clipboard-write\"\n```\n\nThe dApp side also installs a `MutationObserver` that strips `inert`\nattributes injected onto the dialog by browser extensions (a known issue\nwith 1Password and similar).\n\nThe actual visibility/clickjacking defence (the IO-v2 `isVisible` check\nthat disables `pointer-events` when the iframe is occluded) lives in the\n**wallet host application**, not in this SDK — it's a property of being\ndelivered cross-origin in an iframe and would not be meaningful on the\nparent side.\n\n## Public API\n\n```ts\n// Top-level (consumed by most dApps)\nimport {\n  createWallet,\n  type Wallet,\n  type WalletConfig,\n  type Eip1193Provider,\n} from '@abstract-foundation/wallet-sdk';\n\n// Lower-level primitives (for embedders / framework wrappers)\nimport {\n  Dialog,\n  Messenger,\n  UserAgent,\n  IntersectionObserver,\n} from '@abstract-foundation/wallet-sdk/core';\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-48a89f3abeeaeb202aca253259c6dfd0"}