{"_id":"@atlasprotocol/server-sdk","_rev":"9-49b49bc925e11782dbbc15cc9c45b90e","name":"@atlasprotocol/server-sdk","dist-tags":{"latest":"0.7.0"},"versions":{"0.1.0":{"name":"@atlasprotocol/server-sdk","version":"0.1.0","keywords":["atlas","atlas-protocol","server","well-known","x402","usdc","events"],"license":"MIT","_id":"@atlasprotocol/server-sdk@0.1.0","maintainers":[{"name":"nooblemon_eth","email":"kc@lemonade.social"}],"homepage":"https://github.com/lemonadesocial/atlas-protocol#readme","bugs":{"url":"https://github.com/lemonadesocial/atlas-protocol/issues"},"dist":{"shasum":"12f8d6ed82bab21f25d99e0304c429d2f78b6a41","tarball":"https://registry.npmjs.org/@atlasprotocol/server-sdk/-/server-sdk-0.1.0.tgz","fileCount":43,"integrity":"sha512-acDhHZ/QfHpB1HfiFG9G62XKka+FdN/bYWhBVJh3rX5fi7KHjuEAdetWCTP41baxH2l+IWDc2cs7emAmsmQCxQ==","signatures":[{"sig":"MEUCIQC/GU8na8kHIvqwpJdOSlHgtSU8/5I3tSbSuWPv1J+SVQIgJykMjeFI2tbPh191AQjwFvuGySpEeuYKQFy3R/r6VXI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atlasprotocol%2fserver-sdk@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":81978},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"7af48bdc455a16b92154f888643d588c162e98d2","scripts":{"lint":"echo \"no lint configured\" && exit 0","test":"vitest run","build":"tsc -p tsconfig.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"nooblemon_eth","email":"kc@lemonade.social"},"repository":{"url":"git+https://github.com/lemonadesocial/atlas-protocol.git","type":"git","directory":"packages/server-sdk"},"_npmVersion":"10.9.7","description":"Server-side ATLAS Protocol primitives. Manifest generation, schema mapping, multi-chain payment verification. Framework-agnostic.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"viem":"^2.21.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","typescript":"^5.6.3","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/server-sdk_0.1.0_1777548803254_0.6226966544861516","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@atlasprotocol/server-sdk","version":"0.1.1","keywords":["atlas","atlas-protocol","server","well-known","x402","usdc","events"],"license":"MIT","_id":"@atlasprotocol/server-sdk@0.1.1","maintainers":[{"name":"nooblemon_eth","email":"kc@lemonade.social"}],"homepage":"https://github.com/lemonadesocial/atlas-protocol#readme","bugs":{"url":"https://github.com/lemonadesocial/atlas-protocol/issues"},"dist":{"shasum":"0af58e1a5ab45b9ba3c543fbdb770465003c34c1","tarball":"https://registry.npmjs.org/@atlasprotocol/server-sdk/-/server-sdk-0.1.1.tgz","fileCount":43,"integrity":"sha512-WDg+zHao7K3Dzs/87kJlI5wgLnND7pnaD7X2kQwKp1ZT5H52g6NbkyoePs5yHi5Gt8Mbeuuf7K/MI5ksEKpWNw==","signatures":[{"sig":"MEQCIDxXrmXf/uuSF6ylwbwenfO1PZgS+agOMrBZRwz07w9nAiAxY9lmZIPBdduXld5XN3aBQ7iy/kozLGSkS6kNdeoGtw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atlasprotocol%2fserver-sdk@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":82506},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"117333a62b200f2d9df3a1b37e69c76ec446ca92","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc -p tsconfig.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc --noEmit -p tsconfig.json","format:check":"prettier --check ."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8310c78d-b78b-4696-8c7c-077ff63abd44"}},"repository":{"url":"git+https://github.com/lemonadesocial/atlas-protocol.git","type":"git","directory":"packages/server-sdk"},"_npmVersion":"11.11.0","description":"Server-side ATLAS Protocol primitives. Manifest generation, schema mapping, multi-chain payment verification. Framework-agnostic.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"viem":"^2.21.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","typescript":"^5.6.3","@types/node":"^24.0.0"},"_npmOperationalInternal":{"tmp":"tmp/server-sdk_0.1.1_1777572908896_0.9593753926330133","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@atlasprotocol/server-sdk","version":"0.2.0","keywords":["atlas","atlas-protocol","server","well-known","x402","usdc","events"],"license":"MIT","_id":"@atlasprotocol/server-sdk@0.2.0","maintainers":[{"name":"nooblemon_eth","email":"kc@lemonade.social"}],"homepage":"https://github.com/lemonadesocial/atlas-protocol#readme","bugs":{"url":"https://github.com/lemonadesocial/atlas-protocol/issues"},"dist":{"shasum":"66b979cce0459a523de6e1ab5caeeb5cce764a24","tarball":"https://registry.npmjs.org/@atlasprotocol/server-sdk/-/server-sdk-0.2.0.tgz","fileCount":55,"integrity":"sha512-wRYnVvuwZ9RT9pao2T0DQRq/IxUJmrfB/csZOoNV5xakjzZQg43QGWHe1kjtRoRTeHwcp+kxGXNCwUyrVnhfoQ==","signatures":[{"sig":"MEUCIQCJeWDSoVqL0M+WmrpqWryf/0xzSsX73i2XYbdjCJ7ivgIgL2PYUFxz+qTS7n2TIkZJBR6027DSEI/+QCdkwqFFOfE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atlasprotocol%2fserver-sdk@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":128237},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"835089646bad9e244176b024d767628fedbde3bb","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc -p tsconfig.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc --noEmit -p tsconfig.json","format:check":"prettier --check ."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8310c78d-b78b-4696-8c7c-077ff63abd44"}},"repository":{"url":"git+https://github.com/lemonadesocial/atlas-protocol.git","type":"git","directory":"packages/server-sdk"},"_npmVersion":"11.11.0","description":"Server-side ATLAS Protocol primitives. Manifest generation, schema mapping, multi-chain payment verification. Framework-agnostic.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"viem":"^2.21.0","@atlasprotocol/mpp":"workspace:^"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","typescript":"^5.6.3","@types/node":"^24.0.0"},"peerDependencies":{"stripe":">=14.0.0"},"peerDependenciesMeta":{"stripe":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/server-sdk_0.2.0_1777708541845_0.2893092535617394","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@atlasprotocol/server-sdk","version":"0.3.0","keywords":["atlas","atlas-protocol","server","well-known","x402","usdc","events"],"license":"MIT","_id":"@atlasprotocol/server-sdk@0.3.0","maintainers":[{"name":"nooblemon_eth","email":"kc@lemonade.social"}],"homepage":"https://github.com/lemonadesocial/atlas-protocol#readme","bugs":{"url":"https://github.com/lemonadesocial/atlas-protocol/issues"},"dist":{"shasum":"aeb4f7b58f3e9a3549f20ced4132bc546e67506e","tarball":"https://registry.npmjs.org/@atlasprotocol/server-sdk/-/server-sdk-0.3.0.tgz","fileCount":83,"integrity":"sha512-MS9LMMADDOsE7hxNaRShADaem+07Lp6+mhxCWtufSRePJeh/WV+XzrHCaX+OOFoYUD7oh+DgkGzjTJEBpLbSIQ==","signatures":[{"sig":"MEYCIQDj13idCFPTOdhUbZbb8nPubx6U3cBZW5v7Gh+EeVzoFwIhALEl6qDpm7Bx3XB0dewW64eVZqRiwRCw/9OjNGOw0Eoa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atlasprotocol%2fserver-sdk@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":421444},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"7916bb19b9ca5e086ed2ea2ae7672b1d647b4f1a","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc -p tsconfig.json && node ./scripts/copy-deployments.mjs","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc --noEmit -p tsconfig.json","format:check":"prettier --check ."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8310c78d-b78b-4696-8c7c-077ff63abd44"}},"repository":{"url":"git+https://github.com/lemonadesocial/atlas-protocol.git","type":"git","directory":"packages/server-sdk"},"_npmVersion":"11.11.0","description":"Server-side ATLAS Protocol primitives. Manifest generation, schema mapping, multi-chain payment verification. Framework-agnostic.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"zod":"^3.23.0","viem":"^2.21.0","@atlasprotocol/mpp":"workspace:^"},"_hasShrinkwrap":false,"devDependencies":{"hono":"^4.6.0","vitest":"^2.0.0","typescript":"^5.6.3","@types/node":"^24.0.0"},"peerDependencies":{"hono":">=4.0.0","stripe":">=14.0.0"},"peerDependenciesMeta":{"hono":{"optional":true},"stripe":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/server-sdk_0.3.0_1777766820973_0.17590287431817453","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@atlasprotocol/server-sdk","version":"0.4.0","keywords":["atlas","atlas-protocol","server","well-known","x402","usdc","events"],"license":"MIT","_id":"@atlasprotocol/server-sdk@0.4.0","maintainers":[{"name":"nooblemon_eth","email":"kc@lemonade.social"}],"homepage":"https://github.com/lemonadesocial/atlas-protocol#readme","bugs":{"url":"https://github.com/lemonadesocial/atlas-protocol/issues"},"dist":{"shasum":"3ee8a5f8e9fdacc5a6dd8a132fa25efef26a9510","tarball":"https://registry.npmjs.org/@atlasprotocol/server-sdk/-/server-sdk-0.4.0.tgz","fileCount":91,"integrity":"sha512-z1/L7+g1hLR5bacDwD0gQpWQNfH06Y8+nzIpRCPega+XBziZtR1XTL5WJ8udjM3fCdKL6dc60A5bMqsgXp6mGw==","signatures":[{"sig":"MEQCIB6siDh6GPshOAJmKsA2EvZMX41YqaB8P3FmJWJg8k6CAiAh28Y96FypHKoZgXCPtys4I/bf8gx+Tu/7T8y/IJfJtw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atlasprotocol%2fserver-sdk@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":483894},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"c4e70d9aadcc3f1566aadc46aabcd5406ea12f7d","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc -p tsconfig.json && node ./scripts/copy-deployments.mjs","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc --noEmit -p tsconfig.json","format:check":"prettier --check ."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8310c78d-b78b-4696-8c7c-077ff63abd44"}},"repository":{"url":"git+https://github.com/lemonadesocial/atlas-protocol.git","type":"git","directory":"packages/server-sdk"},"_npmVersion":"11.11.0","description":"Server-side ATLAS Protocol primitives. Manifest generation, schema mapping, multi-chain payment verification. Framework-agnostic.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"zod":"^3.23.0","viem":"^2.21.0","@atlasprotocol/mpp":"workspace:^"},"_hasShrinkwrap":false,"devDependencies":{"hono":"^4.6.0","vitest":"^2.0.0","typescript":"^5.6.3","@types/node":"^24.0.0"},"peerDependencies":{"hono":">=4.0.0","stripe":">=14.0.0"},"peerDependenciesMeta":{"hono":{"optional":true},"stripe":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/server-sdk_0.4.0_1777785594744_0.23319219451231898","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@atlasprotocol/server-sdk","version":"0.5.0","keywords":["atlas","atlas-protocol","server","well-known","x402","usdc","events"],"license":"MIT","_id":"@atlasprotocol/server-sdk@0.5.0","maintainers":[{"name":"nooblemon_eth","email":"kc@lemonade.social"}],"homepage":"https://github.com/lemonadesocial/atlas-protocol#readme","bugs":{"url":"https://github.com/lemonadesocial/atlas-protocol/issues"},"dist":{"shasum":"8877b10fae408e3d53c5ccf1a242e54b2dba6945","tarball":"https://registry.npmjs.org/@atlasprotocol/server-sdk/-/server-sdk-0.5.0.tgz","fileCount":75,"integrity":"sha512-jkxmyoImQ5D+hNY2mvxTZpUun4tZpFehUangb6s11XMcuE8gWxdqU9zZflHYMafgzEa8+LEXOul55prSPMvPaw==","signatures":[{"sig":"MEUCIQDynpeSw6aSGbCHblpvR5FiEOKJRbPM4a4aGPttlKXEyQIgbpxodx1MMU0X++/OykN/RPQ18RaUvZ4YRZsQOlmxGGQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atlasprotocol%2fserver-sdk@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":467913},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"afe9110f5c808ab6cfa2653905a14d6a4784ca7a","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc -p tsconfig.json && node ./scripts/copy-deployments.mjs","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc --noEmit -p tsconfig.json","format:check":"prettier --check ."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8310c78d-b78b-4696-8c7c-077ff63abd44"}},"repository":{"url":"git+https://github.com/lemonadesocial/atlas-protocol.git","type":"git","directory":"packages/server-sdk"},"_npmVersion":"11.11.0","description":"Server-side ATLAS Protocol primitives. Manifest generation, schema mapping, multi-chain payment verification. Framework-agnostic.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"zod":"^3.23.0","viem":"^2.21.0","@atlasprotocol/mpp":"workspace:^","@atlasprotocol/types":"workspace:^"},"_hasShrinkwrap":false,"devDependencies":{"hono":"^4.6.0","vitest":"^2.0.0","typescript":"^5.6.3","@types/node":"^24.0.0"},"peerDependencies":{"hono":">=4.0.0","stripe":">=14.0.0"},"peerDependenciesMeta":{"hono":{"optional":true},"stripe":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/server-sdk_0.5.0_1777789591099_0.568049543536896","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@atlasprotocol/server-sdk","version":"0.6.0","keywords":["atlas","atlas-protocol","server","well-known","x402","usdc","events"],"license":"MIT","_id":"@atlasprotocol/server-sdk@0.6.0","maintainers":[{"name":"nooblemon_eth","email":"kc@lemonade.social"}],"homepage":"https://github.com/lemonadesocial/atlas-protocol#readme","bugs":{"url":"https://github.com/lemonadesocial/atlas-protocol/issues"},"dist":{"shasum":"1f3cb29145d99a488b5e88f15426769008922ba1","tarball":"https://registry.npmjs.org/@atlasprotocol/server-sdk/-/server-sdk-0.6.0.tgz","fileCount":79,"integrity":"sha512-Hxxpjd3nDOWREq76RgsJfZGCeYs8KgBDEKoJDWWxJZLMP9eGJsTUHiobpoXnfARlPdIFcM6LDpleXx2b9UuPig==","signatures":[{"sig":"MEYCIQDQjSdqmIz9PWRwM2jyOFLSq5yjJYUKv7wCwDSe3OwjOgIhALiyZLkLvskYFv68U8nQ9urI+vKbuK+P4Tm9xiMkGZm9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atlasprotocol%2fserver-sdk@0.6.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":523215},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"c43e911bb1ef7a56454e22b39d0498b84ee37333","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc -p tsconfig.json && node ./scripts/copy-deployments.mjs","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc --noEmit -p tsconfig.json","format:check":"prettier --check ."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8310c78d-b78b-4696-8c7c-077ff63abd44"}},"repository":{"url":"git+https://github.com/lemonadesocial/atlas-protocol.git","type":"git","directory":"packages/server-sdk"},"_npmVersion":"11.11.0","description":"Server-side ATLAS Protocol primitives. Manifest generation, schema mapping, multi-chain payment verification. Framework-agnostic.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"zod":"^3.23.0","viem":"^2.21.0","@atlasprotocol/mpp":"workspace:^","@atlasprotocol/types":"workspace:^"},"_hasShrinkwrap":false,"devDependencies":{"hono":"^4.6.0","vitest":"^2.0.0","typescript":"^5.6.3","@types/node":"^24.0.0"},"peerDependencies":{"hono":">=4.0.0","stripe":">=14.0.0"},"peerDependenciesMeta":{"hono":{"optional":true},"stripe":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/server-sdk_0.6.0_1777828549194_0.910189170323801","host":"s3://npm-registry-packages-npm-production"}},"0.6.1":{"name":"@atlasprotocol/server-sdk","version":"0.6.1","keywords":["atlas","atlas-protocol","server","well-known","x402","usdc","events"],"license":"MIT","_id":"@atlasprotocol/server-sdk@0.6.1","maintainers":[{"name":"nooblemon_eth","email":"kc@lemonade.social"}],"homepage":"https://github.com/lemonadesocial/atlas-protocol/tree/main/packages/server-sdk#readme","bugs":{"url":"https://github.com/lemonadesocial/atlas-protocol/issues"},"dist":{"shasum":"32f931717220daad6ea223bcb6f893b1dc1fda76","tarball":"https://registry.npmjs.org/@atlasprotocol/server-sdk/-/server-sdk-0.6.1.tgz","fileCount":80,"integrity":"sha512-krA72M57Js6haVOILKD6KnaC3lUS60CaGBPVYF9wD4VZvf4ui4t+ABlOyfqJxMk5eRojGoSPwedGKrMe2jGEzw==","signatures":[{"sig":"MEUCIQDKqw11LxMc2yjfHPfJApVkRCvMYkcR9QlntZvTTMMVdQIgMzhVs/8Ci/ax/SQTDdl4J0jYNfqou/KtQHd5nLthMK8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atlasprotocol%2fserver-sdk@0.6.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":524674},"main":"dist/index.js","type":"module","_from":"file:atlasprotocol-server-sdk-0.6.1.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc -p tsconfig.json && node ./scripts/copy-deployments.mjs","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc --noEmit -p tsconfig.json","format:check":"prettier --check ."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8310c78d-b78b-4696-8c7c-077ff63abd44"}},"_resolved":"/tmp/cb30279560fa862892ca4943eff7250e/atlasprotocol-server-sdk-0.6.1.tgz","_integrity":"sha512-krA72M57Js6haVOILKD6KnaC3lUS60CaGBPVYF9wD4VZvf4ui4t+ABlOyfqJxMk5eRojGoSPwedGKrMe2jGEzw==","repository":{"url":"git+https://github.com/lemonadesocial/atlas-protocol.git","type":"git","directory":"packages/server-sdk"},"_npmVersion":"11.11.0","description":"Server-side ATLAS Protocol primitives. Manifest generation, schema mapping, multi-chain payment verification. Framework-agnostic.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"zod":"^3.23.0","viem":"^2.21.0","@atlasprotocol/mpp":"^0.3.0","@atlasprotocol/types":"^0.2.0"},"_hasShrinkwrap":false,"devDependencies":{"hono":"^4.6.0","vitest":"^2.0.0","typescript":"^5.6.3","@types/node":"^24.0.0"},"peerDependencies":{"hono":">=4.0.0","stripe":">=14.0.0"},"peerDependenciesMeta":{"hono":{"optional":true},"stripe":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/server-sdk_0.6.1_1777868771363_0.911541099345105","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@atlasprotocol/server-sdk","version":"0.7.0","description":"Server-side ATLAS Protocol primitives. Manifest generation, schema mapping, multi-chain payment verification. Framework-agnostic.","license":"MIT","homepage":"https://github.com/lemonadesocial/atlas-protocol/tree/main/packages/server-sdk#readme","repository":{"type":"git","url":"git+https://github.com/lemonadesocial/atlas-protocol.git","directory":"packages/server-sdk"},"keywords":["atlas","atlas-protocol","server","well-known","x402","usdc","events"],"type":"module","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"viem":"^2.21.0","zod":"^3.23.0","@atlasprotocol/mpp":"^0.3.0","@atlasprotocol/types":"^0.2.0"},"peerDependencies":{"hono":">=4.0.0","stripe":">=14.0.0"},"peerDependenciesMeta":{"hono":{"optional":true},"stripe":{"optional":true}},"devDependencies":{"@types/node":"^24.0.0","hono":"^4.6.0","typescript":"^5.6.3","vitest":"^2.0.0"},"scripts":{"build":"tsc -p tsconfig.json && node ./scripts/copy-deployments.mjs","test":"vitest run","lint":"eslint .","format:check":"prettier --check .","typecheck":"tsc --noEmit -p tsconfig.json","clean":"rm -rf dist *.tsbuildinfo"},"_id":"@atlasprotocol/server-sdk@0.7.0","bugs":{"url":"https://github.com/lemonadesocial/atlas-protocol/issues"},"_integrity":"sha512-6SH/DHKcl0fgIZ8PY1rZO77qO17zyp2BcS7mh3mTCrXQS+89/lOsebUrisOgZnm1n2Xuq5+6fO8+iTE0a749rg==","_resolved":"/tmp/5e9b1a6e16ffd4d6e496077c2d08d78f/atlasprotocol-server-sdk-0.7.0.tgz","_from":"file:atlasprotocol-server-sdk-0.7.0.tgz","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-6SH/DHKcl0fgIZ8PY1rZO77qO17zyp2BcS7mh3mTCrXQS+89/lOsebUrisOgZnm1n2Xuq5+6fO8+iTE0a749rg==","shasum":"0eb07b16fcdc0b08534884852fd287b16fc35003","tarball":"https://registry.npmjs.org/@atlasprotocol/server-sdk/-/server-sdk-0.7.0.tgz","fileCount":88,"unpackedSize":547988,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atlasprotocol%2fserver-sdk@0.7.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFU0MIkuf80i38fULyopjvOhoAxmOaQvhBLmDgEmlIQ2AiEAinFvd4oS9ow0/WcDY+eWPBLz5Kt2sa4UEFwHyamJ7VI="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8310c78d-b78b-4696-8c7c-077ff63abd44"}},"directories":{},"maintainers":[{"name":"nooblemon_eth","email":"kc@lemonade.social"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/server-sdk_0.7.0_1777874176267_0.06330598389828967"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-30T11:33:23.169Z","modified":"2026-05-04T05:56:16.679Z","0.1.0":"2026-04-30T11:33:23.430Z","0.1.1":"2026-04-30T18:15:09.065Z","0.2.0":"2026-05-02T07:55:41.993Z","0.3.0":"2026-05-03T00:07:01.108Z","0.4.0":"2026-05-03T05:19:54.874Z","0.5.0":"2026-05-03T06:26:31.274Z","0.6.0":"2026-05-03T17:15:49.334Z","0.6.1":"2026-05-04T04:26:11.569Z","0.7.0":"2026-05-04T05:56:16.392Z"},"bugs":{"url":"https://github.com/lemonadesocial/atlas-protocol/issues"},"license":"MIT","homepage":"https://github.com/lemonadesocial/atlas-protocol/tree/main/packages/server-sdk#readme","keywords":["atlas","atlas-protocol","server","well-known","x402","usdc","events"],"repository":{"type":"git","url":"git+https://github.com/lemonadesocial/atlas-protocol.git","directory":"packages/server-sdk"},"description":"Server-side ATLAS Protocol primitives. Manifest generation, schema mapping, multi-chain payment verification. Framework-agnostic.","maintainers":[{"name":"nooblemon_eth","email":"kc@lemonade.social"}],"readme":"# @atlasprotocol/server-sdk\n\nHost a compliant ATLAS Protocol endpoint from any Node HTTP framework. The SDK ships the three primitives every ATLAS server needs — `.well-known/atlas.json` manifest generation, source-platform → ATLAS schema mapping, and multi-chain payment verification — with no Koa/Express/Fastify lock-in and no implicit database access. Drop it into your existing API to expose your event catalog to ATLAS-aware agents and clients.\n\n## Install\n\n```bash\npnpm add @atlasprotocol/server-sdk\n```\n\n## Type imports\n\nProtocol type definitions (`AtlasEvent`, `AtlasTicketType`, `AtlasManifest`, `AtlasPurchaseChallenge`, `AtlasReceipt`, `Pinner`, etc.) live in [`@atlasprotocol/types`](../types). `@atlasprotocol/server-sdk` re-exports every type it consumes from there, so both of these compile against the same declaration:\n\n```ts\n// New code: import directly from the types package.\nimport type { AtlasEvent, AtlasReceipt } from '@atlasprotocol/types';\n\n// Existing code: keep importing from server-sdk — same types, no behavior change.\nimport type { AtlasEvent, AtlasReceipt } from '@atlasprotocol/server-sdk';\n```\n\nRuntime exports (the zod schemas like `AtlasEventSchema`, the `generateReceipt` builder, the W3C VC URL constants) live here in `server-sdk` and are not duplicated in `@atlasprotocol/types` — that package is types-only.\n\n## Quickstart\n\n```ts\nimport {\n  generateManifest,\n  toAtlasEvent,\n  verifyPayment,\n  type ServerSdkConfig,\n} from '@atlasprotocol/server-sdk';\n\nconst config: ServerSdkConfig = {\n  platform: { name: 'Lemonade', url: 'https://lemonade.social' },\n  domain: 'atlas.lemonade.social',\n  feeSchedule: { protocolFeePercent: 2, platformFeePercent: 3.5 },\n  paymentMethods: [\n    { type: 'base_usdc', receiverAddress: '0x...' },\n    { type: 'stripe_spt', stripeSecretKey: process.env.STRIPE_SECRET_KEY! },\n  ],\n  signingKeys: [/* JWKs */],\n  rateLimits: { searchPerMinute: 100, purchasePerMinute: 10 },\n};\n\nconst manifest = generateManifest(config);                // serve at /.well-known/atlas.json\nconst event    = toAtlasEvent(myEvent, mySpace, ticketTypes, {\n  sourcePlatform: 'lemonade',\n  platformUrl:    'https://app.lemonade.social',\n  baseUrl:        'https://atlas.lemonade.social',\n  acceptedPaymentMethods: ['base_usdc', 'stripe_spt'],\n});\nconst result   = await verifyPayment(config, proof, params);\n```\n\n## Configuration (`ServerSdkConfig`)\n\n| Field | Description |\n|-------|-------------|\n| `platform` | Branding (`name`, `url`, optional `logoUrl`, `description`, `contactEmail`) embedded in the manifest. |\n| `domain` | ATLAS API base host (`atlas.example.com`). The SDK derives `endpoints.events`, `endpoints.search`, etc. from this. |\n| `feeSchedule` | `{ protocolFeePercent, platformFeePercent, paymentProcessingNote? }` — advertised in the manifest and used by the schema mapper. |\n| `paymentMethods` | Array of `PaymentMethodConfig`. Each entry declares the chain/scheme and its receiver address (EVM) or API credential (Stripe). |\n| `signingKeys` | JWK array advertised in the manifest. Used by clients to verify signed receipts. |\n| `rateLimits` | `{ searchPerMinute, purchasePerMinute }` — advertised in the manifest. |\n| `logger` | Optional `Logger` (`debug`/`info`/`warn`/`error`). Defaults to a no-op logger. |\n\n## Supported chains\n\n| Method | Chain | Default RPC | Default confirmations |\n|--------|-------|-------------|------------------------|\n| `tempo_usdc` | Tempo (4217) | `https://rpc.tempo.xyz` | 1 |\n| `base_usdc` | Base (8453) | `https://mainnet.base.org` | 12 |\n| `arbitrum_usdc` | Arbitrum (42161) | `https://arb1.arbitrum.io/rpc` | 64 |\n| `polygon_usdc` | Polygon (137) | `https://polygon-rpc.com` | 128 |\n| `optimism_usdc` | Optimism (10) | `https://mainnet.optimism.io` | 10 |\n| `zksync_usdc` | zkSync Era (324) | `https://mainnet.era.zksync.io` | 1 |\n| `stripe_spt` | Stripe Stablecoin Payment Token | n/a | n/a |\n\nFor Stripe SPT, pass a `verifyStripe` callback to `verifyPayment(config, proof, params, deps)` — the SDK does not bundle the Stripe SDK, so you wire your own.\n\nFor replay protection, pass a `deps.isReplay(proof)` callback that checks your payment store; if omitted, replay protection is the host application's responsibility.\n\n## Hold lifecycle\n\nEvery 402 challenge is backed by a server-side **hold** that locks the requested inventory until payment lands or the hold expires. The SDK ships an in-memory `HoldStore` for tests / single-process deployments and a `createHold` helper that enforces the protocol's 300-second minimum TTL.\n\n```ts\nimport { createHold, InMemoryHoldStore } from '@atlasprotocol/server-sdk';\n\nconst store = new InMemoryHoldStore();\n\nconst hold = createHold({\n  eventId: 'evt_abc123',\n  ticketTypeId: 'tt_ga_001',\n  quantity: 2,\n  attendee: '0x...',\n  organizerAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f8fE00',\n  totalAmountUsdMicros: 50_000_000n,\n  idempotencyKey: req.headers['idempotency-key'],\n  ttlSeconds: 300,\n});\nawait store.create(hold);\n\n// Later, when the agent submits a payment proof:\nconst result = await store.consume(hold.id, idempotencyKey);\nswitch (result.status) {\n  case 'consumed':         /* mint receipt + tickets */ break;\n  case 'already_consumed': /* return original receipt */ break;\n  case 'expired':          /* respond 410 hold_expired */ break;\n  case 'not_found':        /* respond 404 */ break;\n}\n\n// Periodic sweep — releases inventory back into circulation.\nawait store.expireOlderThan(new Date());\n```\n\nProduction hosts should implement the `HoldStore` interface against Redis (or any store that supports atomic compare-and-set) so `consume` is atomic across replicas.\n\n## Replay protection\n\nEvery accepted MPP credential is fingerprinted with a SHA-256 hash of its canonical (JCS) wire bytes. The replay store rejects a second presentation of the same credential — by the same agent or any other.\n\n```ts\nimport { InMemoryReplayStore, verifyMppCredential } from '@atlasprotocol/server-sdk';\n\nconst replayStore = new InMemoryReplayStore({ ttlMs: 24 * 60 * 60 * 1000 });\n\nconst result = await verifyMppCredential(envelope, challengeId, {\n  replayStore,\n  // Delegate the host's deeper payment verification (e.g. on-chain RPC).\n  verify: (env) => myPaymentVerifier(env),\n});\n\nif (!result.valid) {\n  switch (result.error) {\n    case 'replayed':           return res.status(409).json({ error: 'replay_rejected' });\n    case 'expired':            return res.status(410).json({ error: 'hold_expired' });\n    case 'challenge_mismatch': return res.status(422).json({ error: 'challenge_mismatch' });\n    case 'invalid_envelope':   return res.status(400).json({ error: 'bad_request' });\n    case 'verification_failed': return res.status(402).json({ error: 'payment_invalid', message: result.message });\n  }\n}\n```\n\nThe replay store enforces the 24-hour idempotency window from the protocol spec (§3.6). Production hosts should back the `ReplayStore` interface with Redis using `SET … NX EX <ttl>` for atomicity.\n\n## Receipts\n\nSuccessful purchases produce a W3C Verifiable Credential receipt that mirrors the canonical `AtlasTicketReceipt` schema (`01-whitepaper/docs/02-SCHEMAS.md` §5 and `01-PROTOCOL-SPEC.md` §4). `generateReceipt` returns an unsigned credential — the host attaches an ES256 JWS proof block before publishing.\n\n`generateReceipt` is **async** and returns `{ receipt, cid? }`. The `cid` is populated when an optional `pinner` is supplied (see *Receipt auto-pinning* below).\n\n```ts\nimport { generateReceipt } from '@atlasprotocol/server-sdk';\n\n// On-chain settlement:\nconst { receipt } = await generateReceipt({\n  holdId: 'hold_xyz789',\n  eventId: 'evt_abc123',\n  attendee: '0x9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c3b2a1f0e',\n  organizerAddress: 'did:web:bjc.events',\n  paymentMethod: 'x402',\n  txHash: '0xabcdef…',\n  settlementChain: 'base',\n  amount: '50.000000',\n  currency: 'USDC',\n  ticketTypeId: 'tt_ga_001',\n  quantity: 2,\n});\n\n// Stripe SPT settlement:\nconst { receipt: stripeReceipt } = await generateReceipt({\n  /* …same fields… */\n  paymentMethod: 'stripe_spt',\n  paymentIntentId: 'pi_test_123',\n  amount: '50.00',\n  currency: 'USD',\n});\n```\n\nThe returned credential includes the canonical `@context` (`https://www.w3.org/2018/credentials/v1` and `https://atlas.events/credentials/v1`) and `type: [\"VerifiableCredential\", \"AtlasTicketReceipt\"]`. Sign with ES256 using a key listed in the issuer's `signing_keys` manifest.\n\n### Receipt auto-pinning\n\nPass a `pinner` from `@atlasprotocol/ipfs` and the receipt is canonicalized and pinned to IPFS in the same call. The returned `cid` is the content-addressed identifier of the canonicalized receipt JSON.\n\n```ts\nimport { generateReceipt } from '@atlasprotocol/server-sdk';\nimport { PinataPinner } from '@atlasprotocol/ipfs';\n\nconst pinner = new PinataPinner({ jwt: process.env.PINATA_JWT! });\n\nconst { receipt, cid } = await generateReceipt({\n  holdId: 'hold_xyz789',\n  eventId: 'evt_abc123',\n  attendee: '0x9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c3b2a1f0e',\n  organizerAddress: 'did:web:bjc.events',\n  paymentMethod: 'x402',\n  txHash: '0xabcdef…',\n  settlementChain: 'base',\n  amount: '50.000000',\n  currency: 'USDC',\n  pinner,\n});\nconsole.log(cid); // bafy… — the pinned, canonicalized receipt\n```\n\nAny `Pinner` works: `PinataPinner`, `Web3StoragePinner`, `FilebasePinner`, or `KuboPinner`. `@atlasprotocol/ipfs` is an **optional** peer dependency — only install it if you opt into auto-pinning.\n\n> **Breaking change in 0.4.0.** `generateReceipt` was previously sync and returned an `AtlasReceipt` directly. It is now `async` and returns `{ receipt, cid? }`. Migrate by adding `await` and destructuring `receipt`.\n\n## End-to-end flow\n\nBelow is the end-to-end purchase flow exercised by `examples/dual-protocol-server` and the `end-to-end.test.ts` test. The SDK ships the primitives — your server composes them into a single endpoint. The same `paymentId` flows unchanged through verify → mint → reward → receipt; the contracts revert on a second mint or `recordReward` for the same `paymentId`, so retried settlement jobs are safe by construction.\n\n```mermaid\nsequenceDiagram\n  participant Agent\n  participant Server\n  participant Chain as Chain (FeeRouter / AtlasTicket / RewardLedger)\n  participant IPFS as IPFS (Pinner)\n\n  Agent->>Server: GET /events/:id/buy\n  Server-->>Agent: 402 (manifest + challenge)\n  Agent->>Chain: settle(organizer, amount, paymentId)\n  Agent->>Server: POST /events/:id/buy (credential)\n  Server->>Chain: verify settlement (eth_call FeeRouter.isSettled)\n  Server->>Chain: mint(to, eventId, paymentId, tokenURI)\n  Server->>Chain: recordReward(organizer, ORGANIZER, fee, paymentId)\n  Server->>IPFS: pinJson(receipt)\n  IPFS-->>Server: cid\n  Server-->>Agent: 200 { receipt, cid }\n```\n\nThe Stripe SPT rail substitutes `stripe.paymentIntents.retrieve(...)` for the on-chain settlement check; everything downstream (mint, reward, pin) is identical.\n\n## Approval-required events\n\nFor events whose ticket type is `approval_required`, the server returns a 202 envelope instead of 402. The agent submits a join request, then receives a fresh 402 challenge once the host approves.\n\n```ts\nimport { generateMppChallenge } from '@atlasprotocol/server-sdk';\n\nconst { payload } = generateMppChallenge({\n  eventId: 'evt_gated',\n  holdId: 'hold_pending',\n  amountUsdcMicros: 50_000_000n,\n  organizerAddress: '0x...',\n  acceptedChains: ['base_usdc'],\n  acceptStripe: false,\n  requiresApproval: true,\n  joinRequestId: 'jr_42',\n});\n\nctx.status = 202;\nctx.body = payload;\n// payload.status === 'pending_approval'\n// no payment_methods, no WWW-Authenticate header\n```\n\nWhen the host approves, regenerate the challenge with `requiresApproval` omitted (the default), set the `WWW-Authenticate` header, and respond 402 to the agent's next purchase attempt.\n\n## Idempotency\n\nWrap any side-effecting handler with `withIdempotency` so retried requests return the original outcome rather than re-running the work. The bundled `InMemoryIdempotencyStore` is process-local (good for tests / single-process deployments); production hosts should back the `IdempotencyStore` interface with Redis (`SET ... NX EX <ttl>`) or any TTL store that supports atomic compare-and-set.\n\n```ts\nimport { InMemoryIdempotencyStore, withIdempotency } from '@atlasprotocol/server-sdk';\n\nconst store = new InMemoryIdempotencyStore();\n\napp.post('/atlas/v1/events/:id/purchase', async (c) => {\n  const idempotencyKey = c.req.header('Idempotency-Key') ?? defaultKey;\n  return withIdempotency(store, idempotencyKey, 24 * 60 * 60, async () => {\n    // … create hold, issue 402 challenge, etc.\n    return responseSnapshot;\n  });\n});\n```\n\nSuccessful results are cached for `ttlSeconds`. Errors are deliberately NOT cached — a failed handler MUST be retryable.\n\n## Rate limiting\n\nToken-bucket limiting per identifier (MPP credential `payer_id` first, IP as fallback). The `createRateLimitMiddleware` factory returns a Hono-compatible middleware that responds 429 with a `Retry-After` header on block.\n\n```ts\nimport { InMemoryRateLimiter, createRateLimitMiddleware } from '@atlasprotocol/server-sdk';\n\nconst purchaseLimiter = new InMemoryRateLimiter({\n  capacity: 60,\n  refillRatePerSecond: 1, // 60 req/min sustained\n});\n\napp.use(\n  '/atlas/v1/events/:id/purchase',\n  createRateLimitMiddleware({ limiter: purchaseLimiter }),\n);\n```\n\n`hono` is a peer dependency — only install it if you use `createRateLimitMiddleware`. Hosts on other frameworks can implement their own adapter against the framework-agnostic `RateLimiter` interface.\n\n## Schema validation\n\nZod schemas mirroring `01-whitepaper/docs/02-SCHEMAS.md` and the existing TypeScript interfaces. Use the `validate*` helpers for a discriminated union you can branch on without importing Zod, or compose the raw schemas (`AtlasManifestSchema`, `AtlasEventSchema`, `AtlasTicketTypeSchema`, `AtlasReceiptSchema`) into your own pipelines.\n\n```ts\nimport {\n  AtlasEventSchema,\n  validateManifest,\n  validateAtlasEvent,\n  validateReceipt,\n} from '@atlasprotocol/server-sdk';\n\nconst result = validateAtlasEvent(json);\nif (!result.valid) {\n  // result.errors[i].path identifies the offending field, e.g. [\"atlas:availability\"]\n  return res.status(422).json({ error: 'invalid_event', details: result.errors });\n}\n\n// Or compose with your own pipeline:\nconst Listing = AtlasEventSchema.extend({ /* additional checks */ });\n```\n\nThe schemas use `.passthrough()` so unknown ATLAS-namespaced fields (e.g. `atlas:promoted` on search results) survive validation; required fields and enums are still strictly checked.\n\n## AtlasTicket NFT helpers\n\nAfter a successful purchase, mint the corresponding ticket NFT with idempotent semantics —\ncalling `mint(...)` twice for the same `paymentId` reverts on chain, so retried settlement\njobs are safe by construction. The SDK ships viem-based helpers that build the calldata, parse\nthe resulting log, and look up the deployed contract address.\n\n```ts\nimport {\n  buildMintTicketTx,\n  getAtlasTicketContractAddress,\n  parseTicketMintedEvent,\n} from \"@atlasprotocol/server-sdk\";\nimport { createWalletClient, http } from \"viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\nimport { base } from \"viem/chains\";\n\nconst contract = getAtlasTicketContractAddress(\"base_usdc\") as `0x${string}`;\nconst tx = buildMintTicketTx({\n  contract,\n  to: \"0x9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c3b2a1f0e\",\n  eventId: 4242n,\n  paymentId: \"0xabcd…\", // bytes32 — same value used on the FeeRouter settle()\n  tokenURI: \"ipfs://Qm…\", // points at the JSON-LD ticket payload\n});\n\nconst wallet = createWalletClient({\n  account: privateKeyToAccount(process.env.MINTER_PRIVATE_KEY as `0x${string}`),\n  chain: base,\n  transport: http(),\n});\nconst hash = await wallet.sendTransaction(tx);\n```\n\nDecode the resulting `TicketMinted` event from the receipt to learn which `tokenId` was issued:\n\n```ts\nimport { parseTicketMintedEvent } from \"@atlasprotocol/server-sdk\";\n\nfor (const log of receipt.logs) {\n  const decoded = parseTicketMintedEvent(log);\n  if (decoded) {\n    // decoded.tokenId, decoded.to, decoded.eventId, decoded.paymentId, decoded.tokenURI\n    break;\n  }\n}\n```\n\nThe contract is deployed via Nick's deterministic CREATE2 factory with salt\n`atlas-protocol/AtlasTicket v0.1.0`, so the **implementation** address is identical on every\nEVM chain. Per-chain proxy addresses live in `deployments.json` at the repo root and are\nexposed via `getAtlasTicketAddress(chainSlug)` / `getAtlasTicketContractAddress(chainSlug)`\n(both names point at the same lookup).\n\n## RewardLedger helpers\n\nRewardLedger is the Stage 3 accrual ledger. The recorder (typically the FeeRouter or backend\nsettlement service) credits per-recipient organizer / attendee / referral rewards in the\nchain's stablecoin; recipients claim their accumulated balance on demand. Recordings are\nidempotent per `(paymentId, kind)` — a second `recordReward` call for the same tuple reverts\non chain, so retried settlement jobs are safe by construction.\n\nThe SDK ships viem-based helpers that build the calldata, parse the resulting logs, and\nlook up the deployed contract address.\n\n```ts\nimport {\n  buildRecordRewardTx,\n  getRewardLedgerContractAddress,\n  RewardKind,\n} from \"@atlasprotocol/server-sdk\";\nimport { createWalletClient, http } from \"viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\nimport { base } from \"viem/chains\";\n\nconst contract = getRewardLedgerContractAddress(\"base_usdc\") as `0x${string}`;\nconst tx = buildRecordRewardTx({\n  contract,\n  recipient: \"0x9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c3b2a1f0e\",\n  kind: RewardKind.Organizer,\n  amount: 600_000n, // 0.60 USDC at 6 decimals\n  paymentId: \"0xabcd…\", // bytes32 — same value used on the FeeRouter settle()\n});\n\nconst wallet = createWalletClient({\n  account: privateKeyToAccount(process.env.RECORDER_PRIVATE_KEY as `0x${string}`),\n  chain: base,\n  transport: http(),\n});\nconst hash = await wallet.sendTransaction(tx);\n```\n\nA recipient withdraws their balance with `buildClaimTx`. The transaction is signed by the\nrecipient's own wallet — no role required, anyone can call `claim()` for themselves:\n\n```ts\nimport { buildClaimTx } from \"@atlasprotocol/server-sdk\";\n\nconst claimTx = buildClaimTx({ contract });\nconst hash = await recipientWallet.sendTransaction(claimTx);\n```\n\nRead a recipient's accrued unclaimed balance with `getRewardBalance` — the caller supplies\ntheir own viem `PublicClient` so the SDK does not pin a transport:\n\n```ts\nimport { getRewardBalance } from \"@atlasprotocol/server-sdk\";\nimport { createPublicClient, http } from \"viem\";\nimport { base } from \"viem/chains\";\n\nconst client = createPublicClient({ chain: base, transport: http() });\nconst balance = await getRewardBalance(client, {\n  contract,\n  recipient: \"0x9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c3b2a1f0e\",\n});\n// balance is a bigint of unclaimed 6-decimal stablecoin units.\n```\n\n> **Enum stability.** The `RewardKind` enum (`Organizer = 0`, `Attendee = 1`, `Referral = 2`)\n> is part of the on-chain ABI. Do **not** reorder the values without a coordinated upgrade\n> across the contract, this SDK, and any indexer that decodes `RewardRecorded.kind` by integer\n> value. The vitest suite pins these values so an accidental reorder fails the build.\n\nThe contract is deployed via Nick's deterministic CREATE2 factory with salt\n`atlas-protocol/RewardLedger v0.1.0`. Per-chain proxy addresses live in `deployments.json`\nat the repo root and are exposed via `getRewardLedgerAddress(chainSlug)` /\n`getRewardLedgerContractAddress(chainSlug)`.\n\n## ATLAS-managed services\n\nFor platforms that don't want to operate their own IPFS pinner, hot wallet, or RPC, the SDK ships an operator-side client that delegates receipt pinning, settlement, and reward recording to a hosted `atlas-registry` deployment. The four primitives below mirror the four registry endpoints — platforms call them after issuing a 200 to the agent, exactly where they would otherwise call `pinJson(...)`, `buildSettleTx(...)`, and `buildRecordRewardTx(...)` directly.\n\n```ts\nimport { createAtlasManagedClient } from '@atlasprotocol/server-sdk';\n\nconst atlas = createAtlasManagedClient({\n  baseUrl: 'https://registry.atlas-protocol.org',\n  platformAuthToken: process.env.ATLAS_PLATFORM_TOKEN, // forwarded as `Authorization: Bearer <token>`\n  // Optional overrides:\n  // fetch:     globalThis.fetch,\n  // timeoutMs: 30_000,\n});\n```\n\n### Pin a receipt\n\n```ts\nconst { urn, cid, pinned_at } = await atlas.pinReceipt(receipt);\n// urn: 'urn:atlas:receipt:rec_abc123'\n// cid: 'bafkrei…' — content-addressed CID of the canonicalized W3C VC\n```\n\n### Verify a receipt\n\n`verifyReceipt` accepts either a full receipt (re-validates the JSON-LD shape, signature, and pin hash) or a `{ urn, cid }` lookup tuple (the registry resolves the canonical bytes from its index):\n\n```ts\nconst v1 = await atlas.verifyReceipt(receipt);\nconst v2 = await atlas.verifyReceipt({ urn, cid });\n// { valid: boolean, signature_verified: boolean, hash_match: boolean, errors?: string[] }\n```\n\n### Settle on-chain\n\nThe registry holds the hot wallet. The platform builds the same args it would pass to `buildSettleTx` and the registry executes the transaction. `bigint` amounts are accepted and serialized to decimal-digit strings before transport (the registry validates strings of digits):\n\n```ts\nconst result = await atlas.settle({\n  platformDomain: 'atlas.bjc.events',\n  chain:          'base',\n  organizer:      '0x...',\n  totalAmount:    25_000_000n,           // 25 USDC at 6 decimals\n  paymentId:      '0xabcdef…',\n  platformFees:   [{ recipient: '0x...', amount: 500_000n }],\n});\n// { paymentId, chain, txHash, status: 'submitted' | 'confirmed' | 'failed', explorerUrl }\n```\n\n### Record rewards\n\n```ts\nconst result = await atlas.recordRewards({\n  platformDomain: 'atlas.bjc.events',\n  paymentId:      '0xabcdef…',\n  recipients: [\n    { recipient: '0x...', kind: 'organizer', amount: 600_000n },\n    { recipient: '0x...', kind: 'attendee',  amount: 200_000n },\n  ],\n});\n// { paymentId, chain, txHashes, status: 'submitted'|'confirmed'|'failed'|'partial_failure', explorerUrls?, error? }\n```\n\n### Errors\n\nThe client throws a typed hierarchy:\n\n| Class | When |\n|-------|------|\n| `AtlasManagedRequestError` | Registry returned 4xx (validation, auth, rate limit). |\n| `AtlasManagedServerError`  | Registry returned 5xx. |\n| `AtlasManagedNetworkError` | Fetch threw, request timed out, or the connection aborted. |\n\nAll three extend `AtlasManagedError` and carry `status`, `code`, and optional `details` (parsed from the registry's `{ error: { code, message, details } }` envelope when present).\n\n### Sovereignty alternative\n\nPlatforms that prefer to keep custody of their hot wallet and pinner can still reach the contracts directly via `buildSettleTx` / `buildRecordRewardTx` (see *FeeRouter / RewardLedger helpers* above) and pin via `@atlasprotocol/ipfs`. The two paths are mutually exclusive per settlement — pick one and stay with it for the lifetime of a `paymentId`.\n\n## Spec reference\n\nSee [`../../specs/01-PROTOCOL-SPEC.md`](../../specs/01-PROTOCOL-SPEC.md) for the full ATLAS Protocol manifest format, capability list, and signing-key requirements.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}