{"_id":"@circles-market/sdk","name":"@circles-market/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@circles-market/sdk","version":"0.1.0","private":false,"type":"module","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.cjs","import":"./dist/index.js"}},"sideEffects":false,"scripts":{"build":"tsup src/index.ts --dts --format esm,cjs --sourcemap","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"dependencies":{"@circles-market/auth":"0.1.0","@circles-market/cart":"0.1.0","@circles-market/catalog":"0.1.0","@circles-market/core":"0.1.0","@circles-market/offers":"0.1.0","@circles-market/orders":"0.1.0","@circles-market/sales":"0.1.0","@circles-market/session":"0.1.0","@circles-market/signers":"0.1.0","@circles-profile/core":"0.1.0"},"devDependencies":{"tsup":"^8.3.0","typescript":"^5.6.3"},"_id":"@circles-market/sdk@0.1.0","gitHead":"2bfca7a6816434444613f8ca4349e796179480b5","description":"Client that wires the domain packages together (auth, catalog, cart, orders; optional offers).","_nodeVersion":"24.8.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-cCC8b608Ldi51/D2Iu7kFnvbp0r+fIb7zBV8XGfS8si+XoHDLuEdkd2IK5oTSaJRbLCZjUcRZDrUAe7ZkhPWTw==","shasum":"d5efb02d134c389a90fa66b362c7d353e20028e3","tarball":"https://registry.npmjs.org/@circles-market/sdk/-/sdk-0.1.0.tgz","fileCount":28,"unpackedSize":45685,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHcZqNyBjvG1IPBmxyDD/10WEeGHQqDMcT05UA9FdjnjAiAVVU6bKCyUOG8Wzi8zZRW+J04f+qmGjJB5ApPKonQRAQ=="}]},"_npmUser":{"name":"jaensen","email":"daniel@djanz.de"},"directories":{},"maintainers":[{"name":"jaensen","email":"daniel@djanz.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0_1768922746091_0.1834499499383666"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-20T15:25:45.919Z","0.1.0":"2026-01-20T15:25:46.227Z","modified":"2026-01-20T15:25:46.886Z"},"maintainers":[{"name":"jaensen","email":"daniel@djanz.de"}],"description":"Client that wires the domain packages together (auth, catalog, cart, orders; optional offers).","readme":"# @circles-market/sdk\n\nClient that wires the domain packages together (auth, catalog, cart, orders; optional offers).\n\n## Install\n\n```bash\npnpm add @circles-market/sdk\n```\n\n## Quickstart (full flow)\n\n```ts\nimport { MarketplaceClient } from \"@circles-market/sdk\";\n\nasync function example(marketApiBase: string, ethereum: any, avatar: string) {\n  const client = new MarketplaceClient({ marketApiBase });\n\n  await client.auth.signInWithAvatar({ avatar, ethereum, chainId: 100 });\n\n  const catalogPage = await client.catalog.fetchCatalogPage({\n    operator: \"0x0000000000000000000000000000000000000000\",\n    avatars: [\"0x0000000000000000000000000000000000000000\"],\n    chainId: 100,\n    pageSize: 25,\n  });\n\n  const { basketId } = await client.cart.createBasket({\n    buyer: avatar,\n    operator: \"0x0000000000000000000000000000000000000000\",\n    chainId: 100,\n  });\n\n  await client.cart.setItems({\n    basketId,\n    items: [\n      { seller: catalogPage.items[0]!.seller, sku: catalogPage.items[0]!.product.sku, quantity: 1 },\n    ],\n  });\n\n  const validation = await client.cart.validateBasket(basketId);\n  if (!validation.valid) {\n    return validation;\n  }\n\n  const checkout = await client.cart.checkoutBasket({ basketId });\n  return checkout;\n}\n```\n\n## Reference\n\n### What the client exposes\n\n* `client.catalog` → `@circles-market/catalog`\n* `client.cart` → `@circles-market/cart`\n* `client.orders` → `@circles-market/orders`\n* `client.auth` / `client.signers` / `client.authContext`\n* `client.offers` → only if you pass `profilesBindings`\n\n### `MarketplaceClientOptions`\n\n```ts\ntype MarketplaceClientOptions = {\n  marketApiBase: string;\n  http?: HttpTransport;\n  authContext?: AuthContext;\n  profilesBindings?: ProfilesBindings;\n};\n```\n\nFields:\n- `marketApiBase`: base URL (SDK normalizes trailing slash)\n- `http`: optional transport (default: `FetchHttpTransport`)\n- `authContext`: optional token store (default: `InMemoryAuthContext`)\n- `profilesBindings`: required only for `client.offers`\n\n### Return types (high-level)\n\nSame return types as the domain packages:\n- `client.auth.signInWithAvatar(...)` → `{ address: string; chainId: number }`\n- `client.cart.createBasket(...)` → `{ basketId: string }`\n- `client.cart.checkoutBasket(...)` → `{ orderId: string; paymentReference: string; basketId: string }`\n- `client.orders.list(...)` → `OrderSnapshot[]`\n- `client.catalog.fetchCatalogPage(...)` → `CatalogPage`\n\nFor field-by-field docs, see the corresponding package README.\n\n## Using only one domain package\n\nIf you want only one domain:\n\n* just catalog browsing → `@circles-market/catalog`\n* only basket operations → `@circles-market/cart`\n* only orders → `@circles-market/orders`\n\n## Runtime notes\n\n* Requires global `fetch` (Node 18+ is fine).\n* Orders SSE uses `Response.body.getReader()`.\n","readmeFilename":"README.md","_rev":"1-04f7ffeb3de86e83fa46bce18692c399"}