{"_id":"@adspacedotfun/sdk","name":"@adspacedotfun/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@adspacedotfun/sdk","version":"0.1.0","description":"AdSpace.fun SDK for embedding blockchain-powered advertisements","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}},"./react":{"import":{"types":"./dist/react.d.ts","default":"./dist/react.js"},"require":{"types":"./dist/react.d.ts","default":"./dist/react.cjs"}},"./vue":{"import":{"types":"./dist/vue.d.ts","default":"./dist/vue.js"},"require":{"types":"./dist/vue.d.ts","default":"./dist/vue.cjs"}}},"scripts":{"dev":"vite build --watch","build":"vite build","test":"vitest","lint":"eslint src --ext .ts,.tsx,.vue","prepublishOnly":"npm run build"},"peerDependencies":{"ethers":"^6.0.0","react":"^18.0.0","react-dom":"^18.0.0","vue":"^3.0.0"},"peerDependenciesMeta":{"react":{"optional":true},"react-dom":{"optional":true},"vue":{"optional":true}},"devDependencies":{"@types/node":"^22.0.0","@types/react":"^18.3.0","@types/react-dom":"^18.3.0","@vitejs/plugin-react":"^4.3.0","@vitejs/plugin-vue":"^5.0.0","ethers":"^6.13.0","react":"^18.3.0","react-dom":"^18.3.0","typescript":"^5.5.0","vite":"^5.4.0","vite-plugin-dts":"^4.0.0","vitest":"^2.0.0","vue":"^3.5.0"},"keywords":["adspace","advertising","blockchain","ethereum","nft","web3","sdk","react","vue"],"repository":{"type":"git","url":"git+https://github.com/adspacedotfun/adSpace_webApp.git","directory":"sdk"},"license":"MIT","sideEffects":false,"_id":"@adspacedotfun/sdk@0.1.0","gitHead":"9d488e1ad06395f08ecbc3d259ed3a9f8632ebd0","bugs":{"url":"https://github.com/adspacedotfun/adSpace_webApp/issues"},"homepage":"https://github.com/adspacedotfun/adSpace_webApp#readme","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-1qIJxbUjX3kLAOVtHqrC7k7T9gfjqymELz8zzOYE+Hv+PPxxq8quJRHV4ChRMrhTP/ciki3H50rV0XjntSVs0Q==","shasum":"ee0132d272b6aaa2778e7c56fd06c9d6f9219deb","tarball":"https://registry.npmjs.org/@adspacedotfun/sdk/-/sdk-0.1.0.tgz","fileCount":64,"unpackedSize":172570,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHvfKEzdah/3S7aKShCcBBqFgiqFsyrOE5TwhIVb7qWrAiBATDSgz9lFPTXBA2l+JlZBa4W6ZhdGwjvqG98eCj9vug=="}]},"_npmUser":{"name":"0xraghav","email":"adspace.fun@gmail.com"},"directories":{},"maintainers":[{"name":"0xraghav","email":"adspace.fun@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0_1769875504888_0.6281337514393308"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-31T16:05:04.762Z","0.1.0":"2026-01-31T16:05:05.055Z","modified":"2026-01-31T16:05:05.328Z"},"maintainers":[{"name":"0xraghav","email":"adspace.fun@gmail.com"}],"description":"AdSpace.fun SDK for embedding blockchain-powered advertisements","homepage":"https://github.com/adspacedotfun/adSpace_webApp#readme","keywords":["adspace","advertising","blockchain","ethereum","nft","web3","sdk","react","vue"],"repository":{"type":"git","url":"git+https://github.com/adspacedotfun/adSpace_webApp.git","directory":"sdk"},"bugs":{"url":"https://github.com/adspacedotfun/adSpace_webApp/issues"},"license":"MIT","readme":"# @adspacedotfun/sdk\n\nOfficial SDK for embedding AdSpace.fun blockchain-powered advertisements.\n\n## Structure\n\n```\nsrc/\n├── index.ts          # Main entry (vanilla JS)\n├── react.ts          # React entry\n├── vue.ts            # Vue entry\n│\n├── core/             # Framework-agnostic core\n│   ├── client.ts     # AdSpaceClient - main SDK class\n│   ├── config.ts     # Configuration types & defaults\n│   ├── contracts.ts  # Contract ABIs\n│   ├── types.ts      # TypeScript interfaces\n│   └── utils/        # IPFS & campaign helpers\n│\n├── react/            # React integration\n│   ├── context.tsx   # AdSpaceProvider\n│   ├── hooks/        # useActiveAd hook\n│   └── components/   # AdWidget component\n│\n└── vue/              # Vue integration\n    ├── plugin.ts     # Vue plugin\n    ├── composables/  # useActiveAd composable\n    └── components/   # AdWidget component\n```\n\n## How It Works\n\n1. **AdSpaceClient** connects to the blockchain via JSON-RPC\n2. Calls `getActiveAdImage(spaceId)` on the AdSpaceManager contract\n3. Returns active campaign image (or default ad if none active)\n4. IPFS URLs are resolved to HTTP gateway URLs\n5. Framework integrations provide auto-refresh polling\n\n## Build\n\n```bash\nnpm install\nnpm run build\n```\n\nOutputs ESM, CJS, and TypeScript declarations to `dist/`.\n\n## Publish\n\n```bash\nnpm publish --access public\n```\n","readmeFilename":"README.md","_rev":"1-92b333caca0439d0a368ca94817fd388"}