{"_id":"@burnt-labs/abstraxion-js","_rev":"6-ffd84eec91de41865e444d1d7278fa2c","name":"@burnt-labs/abstraxion-js","dist-tags":{"latest":"1.0.0-alpha.3"},"versions":{"1.0.0-alpha.1":{"name":"@burnt-labs/abstraxion-js","version":"1.0.0-alpha.1","license":"MIT","_id":"@burnt-labs/abstraxion-js@1.0.0-alpha.1","maintainers":[{"name":"burntfilament","email":"filament@burnt.com"},{"name":"burnt_val","email":"val@burnt.com"},{"name":"devops.burnt.com","email":"devops@burnt.com"},{"name":"fuseburnt","email":"fuse@burnt.com"}],"homepage":"https://github.com/burnt-labs/xion.js#readme","bugs":{"url":"https://github.com/burnt-labs/xion.js/issues"},"dist":{"shasum":"cbedc01bad57accc352966206932f6e157302e0c","tarball":"https://registry.npmjs.org/@burnt-labs/abstraxion-js/-/abstraxion-js-1.0.0-alpha.1.tgz","fileCount":71,"integrity":"sha512-/dnGB7s65mRdoe14ddOICmVBSborGb8cmsbb6dm9lhkkag8+YHH994GEzPkhIkz0VulELDCFUJZyHfotcDSUfg==","signatures":[{"sig":"MEQCICY5FuaeFwGcioVej+EvvUGuZLbR6UDfqBoo9Ss1R6VDAiBsCkB+KRBuY0h5w9W4uNajlUlWLSoJE1V3f+mAQ1B9Ug==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":867658},"main":"./dist/index.js","_from":"file:burnt-labs-abstraxion-js-1.0.0-alpha.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"eslint src/","test":"vitest","build":"tsup","clean":"rimraf ./dist","check-types":"tsc --noEmit","test:contract":"vitest run --config vitest.config.contract.ts","test:integration":"vitest run tests/integration --config vitest.config.integration.ts","test:integration:watch":"vitest tests/integration --config vitest.config.integration.ts"},"_npmUser":{"name":"burntfilament","email":"filament@burnt.com"},"_resolved":"/private/var/folders/4x/6nvz9g6s1ggd4xws14lbl3bw0000gn/T/37e8ff6d1d4d82f3d8704cbea23635d8/burnt-labs-abstraxion-js-1.0.0-alpha.1.tgz","_integrity":"sha512-/dnGB7s65mRdoe14ddOICmVBSborGb8cmsbb6dm9lhkkag8+YHH994GEzPkhIkz0VulELDCFUJZyHfotcDSUfg==","repository":{"url":"git+https://github.com/burnt-labs/xion.js.git","type":"git","directory":"packages/abstraxion-js"},"_npmVersion":"11.9.0","description":"The framework-agnostic runtime for XION account abstraction. Owns the per-mode auth state machine, controllers, strategies, and signing clients — with no React, no DOM, and no platform assumptions baked in.","directories":{},"sideEffects":false,"_nodeVersion":"25.6.1","dependencies":{"@cosmjs/stargate":"^0.36.0","@burnt-labs/signers":"1.0.0-alpha.9","@burnt-labs/constants":"0.1.0-alpha.24","@cosmjs/proto-signing":"^0.36.0","@cosmjs/cosmwasm-stargate":"^0.36.0","@burnt-labs/abstraxion-core":"1.0.0-alpha.71","@burnt-labs/account-management":"1.0.0-alpha.12"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^6.0.1","dotenv":"^16.4.5","ethers":"^6","rimraf":"^5.0.5","vitest":"^1.0.0","playwright":"1.48.0","typescript":"^5.2.2","@types/node":"^20","@cosmjs/amino":"^0.36.0","@cosmjs/crypto":"^0.36.0","playwright-core":"1.48.0","@cosmjs/encoding":"^0.36.0","@burnt-labs/test-utils":"1.0.0-alpha.6","@cosmjs/tendermint-rpc":"^0.36.0"},"_npmOperationalInternal":{"tmp":"tmp/abstraxion-js_1.0.0-alpha.1_1781006006675_0.06332269159782333","host":"s3://npm-registry-packages-npm-production"}},"1.0.0-alpha.2":{"name":"@burnt-labs/abstraxion-js","version":"1.0.0-alpha.2","license":"MIT","_id":"@burnt-labs/abstraxion-js@1.0.0-alpha.2","maintainers":[{"name":"burntfilament","email":"filament@burnt.com"},{"name":"burnt_val","email":"val@burnt.com"},{"name":"devops.burnt.com","email":"devops@burnt.com"},{"name":"fuseburnt","email":"fuse@burnt.com"}],"homepage":"https://github.com/burnt-labs/xion.js#readme","bugs":{"url":"https://github.com/burnt-labs/xion.js/issues"},"dist":{"shasum":"f9e5a6048b0b3e9bd7e36d4eadd7af64281c6add","tarball":"https://registry.npmjs.org/@burnt-labs/abstraxion-js/-/abstraxion-js-1.0.0-alpha.2.tgz","fileCount":71,"integrity":"sha512-A3iAdOC167in6uZHTqvq+bJAlKA6yCYFbmLhtoWajke9E7Q6mH34lJiOQRv1HMdD49hbBvH15AnxK6ERiye9Bw==","signatures":[{"sig":"MEYCIQD7nwPYl1M4ukhUB78bfBi97S6n6LuLtWtspPSJH0WHyAIhAOCD0EDweMZivKJM27LQcMzf/u2x8OZHekk/pNvisWzd","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@burnt-labs%2fabstraxion-js@1.0.0-alpha.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":868237},"main":"./dist/index.js","_from":"file:burnt-labs-abstraxion-js-1.0.0-alpha.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"eslint src/","test":"vitest","build":"tsup","clean":"rimraf ./dist","check-types":"tsc --noEmit","test:contract":"vitest run --config vitest.config.contract.ts","test:integration":"vitest run tests/integration --config vitest.config.integration.ts","test:integration:watch":"vitest tests/integration --config vitest.config.integration.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f4ed99ca-1285-4b53-bb1e-5cc6b5583096"}},"_resolved":"/tmp/e34b5f9f5f680ae5804e97acc55153d0/burnt-labs-abstraxion-js-1.0.0-alpha.2.tgz","_integrity":"sha512-A3iAdOC167in6uZHTqvq+bJAlKA6yCYFbmLhtoWajke9E7Q6mH34lJiOQRv1HMdD49hbBvH15AnxK6ERiye9Bw==","repository":{"url":"git+https://github.com/burnt-labs/xion.js.git","type":"git","directory":"packages/abstraxion-js"},"_npmVersion":"11.16.0","description":"The framework-agnostic runtime for XION account abstraction. Owns the per-mode auth state machine, controllers, strategies, and signing clients — with no React, no DOM, and no platform assumptions baked in.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","dependencies":{"@cosmjs/stargate":"^0.36.0","@burnt-labs/signers":"1.0.0-alpha.10","@burnt-labs/constants":"0.1.0-alpha.24","@cosmjs/proto-signing":"^0.36.0","@cosmjs/cosmwasm-stargate":"^0.36.0","@burnt-labs/abstraxion-core":"1.0.0-alpha.72","@burnt-labs/account-management":"1.0.0-alpha.13"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^6.0.1","dotenv":"^16.4.5","ethers":"^6","rimraf":"^5.0.5","vitest":"^1.0.0","playwright":"1.48.0","typescript":"^5.2.2","@types/node":"^20","@cosmjs/amino":"^0.36.0","@cosmjs/crypto":"^0.36.0","playwright-core":"1.48.0","@cosmjs/encoding":"^0.36.0","@burnt-labs/test-utils":"1.0.0-alpha.6","@cosmjs/tendermint-rpc":"^0.36.0"},"_npmOperationalInternal":{"tmp":"tmp/abstraxion-js_1.0.0-alpha.2_1785470110120_0.059396553882326675","host":"s3://npm-registry-packages-npm-production"}},"1.0.0-alpha.3":{"name":"@burnt-labs/abstraxion-js","version":"1.0.0-alpha.3","license":"MIT","_id":"@burnt-labs/abstraxion-js@1.0.0-alpha.3","maintainers":[{"name":"burntfilament","email":"filament@burnt.com"},{"name":"burnt_val","email":"val@burnt.com"},{"name":"zaphodthebeebs","email":"zaphod@burnt.com"},{"name":"devops.burnt.com","email":"devops@burnt.com"}],"homepage":"https://github.com/burnt-labs/xion.js#readme","bugs":{"url":"https://github.com/burnt-labs/xion.js/issues"},"dist":{"shasum":"3f04f0e5817120772544957f21ef53e3be26320a","tarball":"https://registry.npmjs.org/@burnt-labs/abstraxion-js/-/abstraxion-js-1.0.0-alpha.3.tgz","fileCount":91,"integrity":"sha512-Ae7ER778/+tBNevyEV3H79cpNrQtWagszRLSzfu4n4+yVh2wJcMiS0sOiiRm2s+ZwVNwwD1IlvDwiNXOpNhn2w==","signatures":[{"sig":"MEUCIAppJ97R/woDqq2MJTSqMynqfrCzSNJE1gQTJMavCj/LAiEA0q+s7ilPyjFGGAJDVLrktbaIZQompfZmCPJnELnXuHk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@burnt-labs%2fabstraxion-js@1.0.0-alpha.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":934535},"main":"./dist/index.js","_from":"file:burnt-labs-abstraxion-js-1.0.0-alpha.3.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"eslint src/","test":"vitest","build":"tsup","clean":"rimraf ./dist","check-types":"tsc --noEmit","test:contract":"vitest run --config vitest.config.contract.ts","test:integration":"vitest run tests/integration --config vitest.config.integration.ts","test:integration:watch":"vitest tests/integration --config vitest.config.integration.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f4ed99ca-1285-4b53-bb1e-5cc6b5583096"}},"_resolved":"/tmp/18d456ec70e9f844105a228acd861088/burnt-labs-abstraxion-js-1.0.0-alpha.3.tgz","_integrity":"sha512-Ae7ER778/+tBNevyEV3H79cpNrQtWagszRLSzfu4n4+yVh2wJcMiS0sOiiRm2s+ZwVNwwD1IlvDwiNXOpNhn2w==","repository":{"url":"git+https://github.com/burnt-labs/xion.js.git","type":"git","directory":"packages/abstraxion-js"},"_npmVersion":"11.16.0","description":"The framework-agnostic runtime for XION account abstraction. Owns the per-mode auth state machine, controllers, strategies, and signing clients — with no React, no DOM, and no platform assumptions baked in.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","dependencies":{"@cosmjs/stargate":"^0.36.0","@burnt-labs/signers":"1.0.0-alpha.11","@burnt-labs/constants":"0.1.0-alpha.25","@cosmjs/proto-signing":"^0.36.0","@cosmjs/cosmwasm-stargate":"^0.36.0","@burnt-labs/abstraxion-core":"1.0.0-alpha.73","@burnt-labs/account-management":"1.0.0-alpha.14"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","dotenv":"^16.4.5","ethers":"^6","rimraf":"^5.0.5","vitest":"^3.2.7","playwright":"1.61.1","typescript":"^5.2.2","@types/node":"^20","@cosmjs/amino":"^0.36.0","@cosmjs/crypto":"^0.36.0","playwright-core":"1.61.1","@cosmjs/encoding":"^0.36.0","@burnt-labs/test-utils":"1.0.0-alpha.7","@cosmjs/tendermint-rpc":"^0.36.0"},"_npmOperationalInternal":{"tmp":"tmp/abstraxion-js_1.0.0-alpha.3_1786371951126_0.186519602031477","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-06-09T11:53:26.487Z","modified":"2026-08-24T08:11:32.263Z","1.0.0-alpha.1":"2026-06-09T11:53:26.849Z","1.0.0-alpha.2":"2026-07-31T03:55:10.290Z","1.0.0-alpha.3":"2026-08-10T14:25:51.269Z"},"bugs":{"url":"https://github.com/burnt-labs/xion.js/issues"},"license":"MIT","homepage":"https://github.com/burnt-labs/xion.js#readme","repository":{"url":"git+https://github.com/burnt-labs/xion.js.git","type":"git","directory":"packages/abstraxion-js"},"description":"The framework-agnostic runtime for XION account abstraction. Owns the per-mode auth state machine, controllers, strategies, and signing clients — with no React, no DOM, and no platform assumptions baked in.","maintainers":[{"email":"filament@burnt.com","name":"burntfilament"},{"email":"val@burnt.com","name":"burnt_val"},{"email":"ertemann@burnt.com","name":"ertemann"},{"email":"zaphod@burnt.com","name":"zaphodthebeebs"},{"email":"devops@burnt.com","name":"devops.burnt.com"}],"readme":"# @burnt-labs/abstraxion-js\n\nThe framework-agnostic runtime for XION account abstraction. Owns the per-mode auth state machine, controllers, strategies, and signing clients — with no React, no DOM, and no platform assumptions baked in.\n\nYou only need to depend on this package directly if you are:\n\n- Building a non-React/RN integration (Svelte, Vue, SolidJS, vanilla JS)\n- Implementing a custom host (e.g. an Electron preload, a service worker, a test harness) that needs to inject its own storage / redirect / iframe-transport behavior\n- Writing a new framework wrapper sibling to [`@burnt-labs/abstraxion-react`](../abstraxion-react) or [`@burnt-labs/abstraxion-react-native`](../abstraxion-react-native)\n\nIf you are building a **React app**, use [`@burnt-labs/abstraxion-react`](../abstraxion-react). If you are building a **React Native app**, use [`@burnt-labs/abstraxion-react-native`](../abstraxion-react-native). Both wrappers re-export the relevant pieces of this runtime, so you rarely need to import from `abstraxion-js` directly.\n\n## Installation\n\n```bash\nnpm i @burnt-labs/abstraxion-js\n```\n\n## The runtime\n\n`createAbstraxionRuntime(config, strategies?)` is the single entry point. It returns a `runtime` object that owns one controller at a time (the one matching `config.authentication.type`) and exposes a small reactive API:\n\n```ts\nimport { createAbstraxionRuntime } from \"@burnt-labs/abstraxion-js\";\n\nconst runtime = createAbstraxionRuntime({\n  chainId: \"xion-testnet-2\",\n  treasury: \"xion1...\",\n  authentication: { type: \"auto\" },\n});\n\nconst unsubscribe = runtime.subscribe((state) => {\n  // state.isConnected, state.isConnecting, state.granterAddress, state.error, ...\n});\n\nawait runtime.login();\nconst snapshot = runtime.getState();\nawait runtime.logout();\nunsubscribe();\n```\n\nThat's the entire surface a host framework needs to bind to. React's `useSyncExternalStore`, a Svelte `readable` store, a Vue `ref` — all are thin adapters around `runtime.subscribe(listener) → unsubscribe` plus `runtime.getState()`.\n\n## Authentication modes\n\nThe `authentication` field of the config picks the controller:\n\n| Mode       | Controller           | What it does                                                                    |\n| ---------- | -------------------- | ------------------------------------------------------------------------------- |\n| `popup`    | `PopupController`    | Opens the dashboard in a popup window; communicates via `postMessage`.          |\n| `redirect` | `RedirectController` | Full-page redirect to the dashboard; returns to a callback URL.                 |\n| `embedded` | `IframeController`   | Renders the dashboard in an embedded iframe; communicates via `MessageChannel`. |\n| `signer`   | `SignerController`   | Headless — caller supplies a signer (Turnkey / MetaMask / Keplr / custom).      |\n| `auto`     | resolved at init     | Resolves to `popup` on desktop, `redirect` on mobile/PWA.                       |\n\nEach controller surfaces the same state shape via `runtime.subscribe`, so wrappers don't have to special-case modes.\n\n## Strategy injection (running outside the browser)\n\nThe runtime reaches the host environment through three injectable strategies:\n\n```ts\nimport {\n  createAbstraxionRuntime,\n  type StorageStrategy,\n  type RedirectStrategy,\n  type IframeTransportStrategy,\n} from \"@burnt-labs/abstraxion-js\";\n\nconst runtime = createAbstraxionRuntime(config, {\n  strategies: {\n    storageStrategy: myStorageStrategy, // implements StorageStrategy\n    redirectStrategy: myRedirectStrategy, // implements RedirectStrategy\n    iframeTransportStrategy: myIframeTransport, // implements IframeTransportStrategy\n  },\n});\n```\n\nDefaults are browser-native:\n\n- `BrowserStorageStrategy` — `localStorage`\n- `BrowserRedirectStrategy` — `window.location` + `URLSearchParams`\n- `BrowserIframeTransportStrategy` — DOM iframe + `MessageChannel`\n\nYou only override the ones whose default doesn't fit your environment — e.g. `@burnt-labs/abstraxion-react-native` injects an AsyncStorage-backed `StorageStrategy`, an Expo-WebBrowser-backed `RedirectStrategy`, and a `react-native-webview`-backed `IframeTransportStrategy`. Modes you don't use (`signer` doesn't need a redirect strategy, `redirect` doesn't need an iframe transport) can be left unset.\n\n## Direct signing\n\nTwo clients are exposed for direct signing (where the meta-account signs each transaction itself, paying its own gas):\n\n- `RequireSigningClient` — single client that handles popup / redirect / iframe transports. The transport is selected from the active controller; consumers don't pick it directly.\n- `AAClient` — used in `signer` mode; wraps the externally-supplied signer (MetaMask, Keplr, Turnkey, …).\n\nBoth expose the same `signAndBroadcast` / `sendTokens` / `execute` surface, so switching between session-key signing and direct signing is a one-line change in the consumer.\n\n## Public surface (selected exports)\n\n```ts\nexport { createAbstraxionRuntime } from \"@burnt-labs/abstraxion-js\";\nexport type {\n  AbstraxionRuntime,\n  AbstraxionRuntimeOptions,\n} from \"@burnt-labs/abstraxion-js\";\n\nexport {\n  BaseController,\n  IframeController,\n  PopupController,\n  RedirectController,\n  SignerController,\n  createController,\n} from \"@burnt-labs/abstraxion-js\";\n\nexport {\n  BrowserStorageStrategy,\n  BrowserRedirectStrategy,\n  BrowserIframeTransportStrategy,\n} from \"@burnt-labs/abstraxion-js\";\nexport type {\n  IframeTransportStrategy,\n  // RedirectStrategy and StorageStrategy are re-exported from abstraxion-core\n} from \"@burnt-labs/abstraxion-js\";\n\nexport { RequireSigningClient, AAClient } from \"@burnt-labs/abstraxion-js\";\n\nexport {\n  ConnectorType,\n  IframeMessageType,\n  MessageTarget,\n} from \"@burnt-labs/abstraxion-js\";\nexport { AUTHENTICATOR_TYPE } from \"@burnt-labs/abstraxion-js\";\n```\n\nFor configuration types (`AbstraxionConfig`, `AuthenticationConfig`, etc.) see [`packages/abstraxion-js/src/types.ts`](src/types.ts) — they are re-exported from the framework wrappers as well.\n\n## Building a new framework wrapper\n\nThe Svelte demo at [`demos/svelte/`](../../demos/svelte) is the worked example: it creates a runtime, subscribes from a Svelte `writable`, and renders against the resulting store. The same pattern works for Vue (`ref` + `watchEffect`), SolidJS (`createStore`), or any reactivity primitive that can mirror an external subscription.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}