{"_id":"@drakkar.software/octobot-client","_rev":"4-0ef50cf35f2fe6c1d1d6ee92506bd7b3","name":"@drakkar.software/octobot-client","dist-tags":{"latest":"0.8.1"},"versions":{"0.4.0":{"name":"@drakkar.software/octobot-client","version":"0.4.0","license":"GPL-3.0","_id":"@drakkar.software/octobot-client@0.4.0","maintainers":[{"name":"drakkarsoftware","email":"drakkar.software@protonmail.com"}],"homepage":"https://github.com/Drakkar-Software/OctoBot#readme","bugs":{"url":"https://github.com/Drakkar-Software/OctoBot/issues"},"dist":{"shasum":"cfd05fd29e6b6056610f28612202dab1f8e7040b","tarball":"https://registry.npmjs.org/@drakkar.software/octobot-client/-/octobot-client-0.4.0.tgz","fileCount":306,"integrity":"sha512-m6ZRIiWIuLflu+PuY3hyLrJvLeTWMjlwnqj4327Ub2vpRbFHupOOXMawzEkI6lGsHihoU7nK/rLtSrvlT5dMNw==","signatures":[{"sig":"MEUCIEbcKixwC1e+Ob/sHsrgQEYgJCFjB94MA/XrEvAtyv1iAiEAhJKyOnmdSROoUkgOU35DV8C6gVpB9YcpeOl+vvgy8Iw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":722433},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":"./dist/index.js","./crypto":"./dist/crypto/index.js","./identity":"./dist/identity/index.js","./node-api":"./dist/node-api/index.js","./protocol":"./dist/protocol/index.js","./transport":"./dist/transport/index.js","./collections":"./dist/collections/index.js"},"scripts":{"dev":"tsc --build --watch","test":"vitest run","build":"tsc --build","prepublishOnly":"npm run build"},"_npmUser":{"name":"drakkarsoftware","email":"drakkar.software@protonmail.com"},"repository":{"url":"git+https://github.com/Drakkar-Software/OctoBot.git","type":"git","directory":"packages/client/octobot_client_ts"},"_npmVersion":"11.8.0","description":"TypeScript client for the OctoBot node protocol: wallet auth, accounts, automations, strategies, and user actions over the Starfish sync transport.","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"@noble/curves":"2.2.0","@noble/hashes":"2.2.0","@drakkar.software/starfish-client":"3.0.0-alpha.72","@drakkar.software/starfish-spaces":"3.0.0-alpha.72","@drakkar.software/octobot-protocol":"^0.6.0","@drakkar.software/starfish-keyring":"3.0.0-alpha.72","@drakkar.software/starfish-replica":"3.0.0-alpha.72","@drakkar.software/starfish-protocol":"3.0.0-alpha.72","@drakkar.software/starfish-identities":"3.0.0-alpha.72"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.9","typescript":"~5.9.2","@types/node":"^20.11.0"},"_npmOperationalInternal":{"tmp":"tmp/octobot-client_0.4.0_1786206203360_0.9185539835843348","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@drakkar.software/octobot-client","version":"0.5.0","license":"LGPL-3.0","_id":"@drakkar.software/octobot-client@0.5.0","maintainers":[{"name":"drakkarsoftware","email":"drakkar.software@protonmail.com"}],"homepage":"https://github.com/Drakkar-Software/OctoBot#readme","bugs":{"url":"https://github.com/Drakkar-Software/OctoBot/issues"},"dist":{"shasum":"7cf4382709a136dbd211d13a9a58d1190d3558aa","tarball":"https://registry.npmjs.org/@drakkar.software/octobot-client/-/octobot-client-0.5.0.tgz","fileCount":310,"integrity":"sha512-6wW9A+vdK2QTJQlSzJ/9/o5Pk9831f8+fq4Ty1rFkMuD8YKoPSVbnySeOEUpf3Oj1Yxt6pAieTWie9Cme8ScZQ==","signatures":[{"sig":"MEQCICUvow0+OIm/SzJBjcFWVfacODACALKE8ZrHattp7I+lAiB0BIOG249rK352B2CXlcOI2ho+8NjCIJlmUQaO6W5xYg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@drakkar.software%2foctobot-client@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":759939},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":"./dist/index.js","./crypto":"./dist/crypto/index.js","./identity":"./dist/identity/index.js","./node-api":"./dist/node-api/index.js","./protocol":"./dist/protocol/index.js","./transport":"./dist/transport/index.js","./collections":"./dist/collections/index.js"},"gitHead":"ee65ce096f72e61c3a1f3393db3c55117e9a4d42","scripts":{"dev":"tsc --build --watch","test":"vitest run","build":"tsc --build","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b9fc107c-f540-4c4d-8214-e0fdf730ac97"}},"repository":{"url":"git+https://github.com/Drakkar-Software/OctoBot.git","type":"git","directory":"packages/client/octobot_client_ts"},"_npmVersion":"12.0.2","description":"TypeScript client for the OctoBot node protocol: wallet auth, accounts, automations, strategies, and user actions over the Starfish sync transport.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","dependencies":{"@noble/curves":"2.2.0","@noble/hashes":"2.2.0","@drakkar.software/starfish-client":"3.0.0-alpha.72","@drakkar.software/starfish-spaces":"3.0.0-alpha.72","@drakkar.software/octobot-protocol":"^0.6.0","@drakkar.software/starfish-keyring":"3.0.0-alpha.72","@drakkar.software/starfish-replica":"3.0.0-alpha.72","@drakkar.software/starfish-protocol":"3.0.0-alpha.72","@drakkar.software/starfish-identities":"3.0.0-alpha.72"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.9","typescript":"~5.9.2","@types/node":"^20.11.0"},"_npmOperationalInternal":{"tmp":"tmp/octobot-client_0.5.0_1787517167764_0.21379620712572822","host":"s3://npm-registry-packages-npm-production"}},"0.8.0":{"name":"@drakkar.software/octobot-client","version":"0.8.0","license":"LGPL-3.0","_id":"@drakkar.software/octobot-client@0.8.0","maintainers":[{"name":"drakkarsoftware","email":"drakkar.software@protonmail.com"}],"homepage":"https://github.com/Drakkar-Software/OctoBot#readme","bugs":{"url":"https://github.com/Drakkar-Software/OctoBot/issues"},"dist":{"shasum":"5342361c639d03b38f97b295669a16b98e9b02f2","tarball":"https://registry.npmjs.org/@drakkar.software/octobot-client/-/octobot-client-0.8.0.tgz","fileCount":314,"integrity":"sha512-xTb4IDy7heR2juHlx2N8lRZ6L6RrihyFYt3DJhR/GmE62zW2vc73n+rgq3VkT9nwiuhYA7vtnnD44s11gPV1fQ==","signatures":[{"sig":"MEUCICQd3V2S0W/wWFR0iGmYu5kVFS6dHnXBryKdX7/TYLNaAiEA+Yyme0oehrrjeVPlIzB8u7M7JIGXPuRBXGWDoLFZgzc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":774911},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":"./dist/index.js","./crypto":"./dist/crypto/index.js","./identity":"./dist/identity/index.js","./node-api":"./dist/node-api/index.js","./protocol":"./dist/protocol/index.js","./transport":"./dist/transport/index.js","./collections":"./dist/collections/index.js"},"gitHead":"cbcd589527727202436a27f7906591d6b0011d38","scripts":{"dev":"tsc --build --watch","test":"vitest run","build":"tsc --build","prepublishOnly":"npm run build"},"_npmUser":{"name":"drakkarsoftware","email":"drakkar.software@protonmail.com"},"repository":{"url":"git+https://github.com/Drakkar-Software/OctoBot.git","type":"git","directory":"packages/client/octobot_client_ts"},"_npmVersion":"11.8.0","description":"TypeScript client for the OctoBot node protocol: wallet auth, accounts, automations, strategies, and user actions over the Starfish sync transport.","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"@noble/curves":"2.2.0","@noble/hashes":"2.2.0","@drakkar.software/starfish-client":"3.0.0-alpha.72","@drakkar.software/starfish-spaces":"3.0.0-alpha.72","@drakkar.software/octobot-protocol":"^0.8.0","@drakkar.software/starfish-keyring":"3.0.0-alpha.72","@drakkar.software/starfish-replica":"3.0.0-alpha.72","@drakkar.software/starfish-protocol":"3.0.0-alpha.72","@drakkar.software/starfish-identities":"3.0.0-alpha.72"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.9","typescript":"~5.9.2","@types/node":"^20.11.0"},"_npmOperationalInternal":{"tmp":"tmp/octobot-client_0.8.0_1787675158321_0.04140070761387693","host":"s3://npm-registry-packages-npm-production"}},"0.8.1":{"name":"@drakkar.software/octobot-client","version":"0.8.1","description":"TypeScript client for the OctoBot node protocol: wallet auth, accounts, automations, strategies, and user actions over the Starfish sync transport.","license":"LGPL-3.0","repository":{"type":"git","url":"git+https://github.com/Drakkar-Software/OctoBot.git","directory":"packages/client/octobot_client_ts"},"type":"module","publishConfig":{"access":"public"},"main":"./dist/index.js","types":"./dist/index.d.ts","sideEffects":false,"engines":{"node":">=22"},"scripts":{"build":"tsc --build","dev":"tsc --build --watch","test":"vitest run","prepublishOnly":"npm run build"},"exports":{".":"./dist/index.js","./identity":"./dist/identity/index.js","./protocol":"./dist/protocol/index.js","./transport":"./dist/transport/index.js","./crypto":"./dist/crypto/index.js","./collections":"./dist/collections/index.js","./node-api":"./dist/node-api/index.js"},"dependencies":{"@drakkar.software/octobot-protocol":"^0.8.0","@drakkar.software/starfish-client":"3.0.0-alpha.72","@drakkar.software/starfish-identities":"3.0.0-alpha.72","@drakkar.software/starfish-keyring":"3.0.0-alpha.72","@drakkar.software/starfish-protocol":"3.0.0-alpha.72","@drakkar.software/starfish-replica":"3.0.0-alpha.72","@drakkar.software/starfish-spaces":"3.0.0-alpha.72","@noble/curves":"2.2.0","@noble/hashes":"2.2.0"},"devDependencies":{"@types/node":"^20.11.0","typescript":"~5.9.2","vitest":"^2.1.9"},"gitHead":"0e0cb5a2ea3d7200181262415cb5450c49b46309","_id":"@drakkar.software/octobot-client@0.8.1","bugs":{"url":"https://github.com/Drakkar-Software/OctoBot/issues"},"homepage":"https://github.com/Drakkar-Software/OctoBot#readme","_nodeVersion":"22.23.2","_npmVersion":"12.0.2","dist":{"integrity":"sha512-zYGKK2pHRsX37BG9muMiVCUhsMjPQNnBaJiKL6hleYfvvm7B7tSt9PGbw2Xf6+F6oyBWwdPUzryWxZoHeCLdhg==","shasum":"bad8062c9efad88fbe7638a7e7202dd8f086c692","tarball":"https://registry.npmjs.org/@drakkar.software/octobot-client/-/octobot-client-0.8.1.tgz","fileCount":314,"unpackedSize":775197,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@drakkar.software%2foctobot-client@0.8.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCkPXuq0tdUBVtipyFJHFfl4MM8HOGULbfJCyFKULzYbAIhAKtxjzstG9m1rj+5Bif0jL3q5ettdkpUEZN81rmMm/GP"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b9fc107c-f540-4c4d-8214-e0fdf730ac97"}},"directories":{},"maintainers":[{"name":"drakkarsoftware","email":"drakkar.software@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/octobot-client_0.8.1_1788363678494_0.8623744012141379"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-08T16:23:23.203Z","modified":"2026-09-02T15:41:19.060Z","0.4.0":"2026-08-08T16:23:23.535Z","0.5.0":"2026-08-23T20:32:47.903Z","0.8.0":"2026-08-25T16:25:58.468Z","0.8.1":"2026-09-02T15:41:18.663Z"},"bugs":{"url":"https://github.com/Drakkar-Software/OctoBot/issues"},"license":"LGPL-3.0","homepage":"https://github.com/Drakkar-Software/OctoBot#readme","repository":{"type":"git","url":"git+https://github.com/Drakkar-Software/OctoBot.git","directory":"packages/client/octobot_client_ts"},"description":"TypeScript client for the OctoBot node protocol: wallet auth, accounts, automations, strategies, and user actions over the Starfish sync transport.","maintainers":[{"name":"drakkarsoftware","email":"drakkar.software@protonmail.com"}],"readme":"# @drakkar.software/octobot-client\n\nTalk to a self-hosted OctoBot node from TypeScript: wallet identity, accounts, automations,\nstrategies, and user actions over the Starfish sync transport.\n\n## What this is not\n\n- **No local state.** Every read is a fresh pull from the node; nothing is cached.\n- **No persistence.** There is no store, no database, no `AsyncStorage`.\n- **No offline queue.** If the node is unreachable, a call fails — it does not queue for later.\n- **No CRDT merge.** This package has no concept of \"local edits reconciled with remote state.\"\n- **No React.** No hooks, no components, no dependency on any UI framework.\n\nIf you need any of the above (an offline-first mobile app syncing across devices, say), build that\nlayer on top of this package — see [Advanced: building an offline layer on top](https://docs.octobot.cloud/client-sdk/advanced-primitives)\nfor the subpath exports meant for exactly that.\n\n## Install\n\n```bash\nnpm install @drakkar.software/octobot-client\n```\n\n**Runtime requirements:** WebCrypto (`crypto.subtle` — SHA-256/512, HMAC, PBKDF2, AES-GCM, HKDF),\n`fetch`, `btoa`/`atob`, `AbortController`. Available natively in Node ≥18, all modern browsers, and\nDeno/Bun. React Native needs a crypto polyfill (`react-native-quick-crypto` or similar) — this\npackage does not bundle one.\n\n## Hello world\n\n```ts\nimport { connectOctoBot, strategy } from '@drakkar.software/octobot-client'\n\nconst octobot = await connectOctoBot({\n  url: 'http://192.168.1.10:5001',\n  seed: process.env.OCTOBOT_PRIVATE_KEY!, // a raw 0x-prefixed private key\n})\n\nconst [account] = await octobot.accounts.list()\n\nconst dca = strategy.dca({ pairs: ['BTC/USDT'], buyOrderAmount: '25' })\nconst action = await octobot.automations.create({\n  name: 'My DCA',\n  strategy: dca,\n  accountIds: [account.id],\n})\n\nconst automation = await action.settled() // polls the node until it confirms\nconsole.log(automation.id, automation.status) // 'live'\n```\n\n## Five concepts\n\n1. **A node is a server you point at.** `connectOctoBot({ url, seed })` — no registration, no\n   cloud account. Anyone running their own OctoBot node can be your `url`.\n2. **The wallet IS the identity.** There's no separate login. The private key (or a BIP39 mnemonic,\n   which derives one) deterministically derives both the address the node authorizes and the\n   encryption key for everything synced to it. See\n   [Identity](https://docs.octobot.cloud/client-sdk/identity) — this is the single most important\n   thing to get right, and the easiest to get subtly wrong.\n3. **Collections, not tables.** `accounts`, `settings`, `strategies`, `user-data` are documents at\n   fixed paths under `users/{identity}/...`, pulled and pushed as whole blobs, encrypted per-collection.\n4. **User actions are a queue, not an RPC call.** Creating an account or starting an automation\n   doesn't happen synchronously — it appends one element to an append-only queue the node consumes\n   and executes. `ActionHandle.settled()` is how you wait for the result. See\n   [User actions](https://docs.octobot.cloud/client-sdk/user-actions).\n5. **`ActionHandle` work starts eagerly.** The moment `accounts.create()`/`automations.create()`\n   returns a handle, the underlying action is already appended (and, for automations, the two-phase\n   orchestration is already running). `settled()` just lets you observe the outcome — a caller who\n   never awaits it still leaves nothing half-done.\n\n## API map\n\n| | |\n|---|---|\n| `connectOctoBot(options)` | Connect to a node. Returns an `OctoBotClient`. |\n| `strategy.dca/grid/marketMaking/copy/signal/index/genericProcess(input)` | Pure, zero-I/O strategy builders. |\n| `strategy.build(input)` / `.toInput(strategy)` / `.bumpVersion(v)` | The discriminated-union entry point, its inverse, and version bumping. |\n| `client.accounts.list/get/create/update/delete/refresh/trading` | Exchange, wallet, and generic accounts. |\n| `client.automations.list/get/create/update/stop` | Running bots. |\n| `client.strategies.list/get/create/update/delete` | Reconstructed from the action history — the node has no strategies collection of its own. |\n| `client.settings.get/patch/replace` | An opaque document the node stores encrypted and never reads. |\n| `client.node.status/tradedPairs/predictedOrderBook/requiredFunds/dslKeywords/exportWallet/createGenericProcessBot` | The node's direct REST API. The last three need `basicAuth`. |\n| `client.documents.pull/push/append` + `.raw` | Escape hatch: any collection, the raw `StarfishClient`. |\n| `client.close()` | Drops the derived-key cache. |\n| `createReadOnlyPairing(seed, derivation, node)` | Mint a scoped, node-enforced read-only credential for a less-trusted device. See [Read-only devices](https://docs.octobot.cloud/client-sdk/read-only-pairing). |\n| `connectReadOnlyDevice(pairingPayload)` | Connect with that credential instead of a seed. Write methods return a `ProposedAction` (build, don't send) instead of an `ActionHandle`. |\n| `startPairingRequest(options)` / `fetchPairingRequestByCode({code, rendezvous})` | Website side: publish a device-code pairing request; phone side: look it up (returns `{request, hash}`). See [Website pairing](https://docs.octobot.cloud/client-sdk/website-pairing). |\n| `mintPairingGrant(session, request)` / `publishPairingGrant(...)` | Phone side, on approval: invite the website's device into the cloud mirror as a read-only `space:member`, then seal and publish the grant. |\n| `awaitPairingGrant(session, options)` / `fetchPairingGrant(session, options)` | Website side: wait for (or poll for) the grant, unseal it, and live-read the mirror collections it covers. |\n| `revokePairingGrant(...)` / `clearPairingGrant(...)` | Unpair: remove the website's space membership and clear the rendezvous slot. |\n\n## Errors\n\nEvery `OctoBotClient`/`ReadOnlyOctoBotClient` method, and the `client/pairing/*` functions above\n(`startPairingRequest`, `fetchPairingGrant`, etc.), throw an `OctoBotError` subclass (or let an\n`AbortError` `DOMException` through unwrapped, per the platform convention). Switch on `.code`\nrather than `instanceof` if you need the check to survive a duplicated package instance. Full\ntaxonomy, extra fields, and handling patterns: [Errors](https://docs.octobot.cloud/client-sdk/errors).\nThe two exceptions are the I/O-free `identity/pairingRequest.js` and `identity/pairing.js` pure\nfunctions (`createPairingRequest`, `parsePairingRequest`, `createReadOnlyPairing`,\n`parseReadOnlyPairing`) — they validate/build payloads only, never touch the network, and throw a\nplain `Error` rather than an `OctoBotError`.\n\n| Class | `code` | When |\n|---|---|---|\n| `OctoBotConfigError` | `'config'` | Bad `ConnectOptions` — unparseable `url`, or a `node.*` call made without `basicAuth`. |\n| `OctoBotConnectionError` | `'unreachable' \\| 'timeout' \\| 'aborted'` | The node could not be reached. |\n| `OctoBotAuthError` | `'unauthorized'` | The node answered but didn't authorize this wallet — carries `.address`/`.userId`/`.derivation` so you can see what was tried. |\n| `OctoBotHttpError` | `'http'` | A node REST call answered non-2xx. Carries `.status`. |\n| `OctoBotConflictError` | `'conflict'` | A document push raced another writer. Carries `.serverHash` — pull again and retry. |\n| `OctoBotActionError` | `'action_failed'` | The node executed a queued action and rejected it. Not retriable by resubmitting unchanged. |\n| `OctoBotTimeoutError` | `'action_timeout'` | `settled()` gave up waiting — the action may still complete. |\n| `OctoBotScopeError` | `'forbidden_collection'` | A read-only session reached a collection outside its pairing grant — thrown client-side, before any request. |\n\n## Escape hatches\n\n- **Custom `fetch`** — `ConnectOptions.fetch`, for proxies, mTLS, or a React Native polyfill.\n- **`verify: false`** — skip the connect-time probe; `connectOctoBot()` does zero I/O and the first\n  real call surfaces any problem.\n- **Raw documents** — `client.documents.pull/push/append` for any collection, typed loosely; and\n  `client.documents.raw` for the underlying `StarfishClient` and cap provider directly.\n- **`seedDerivation: 'auto'`** — tries every registered derivation scheme and keeps whichever the\n  node authorizes.\n\nFull detail: [Escape hatches](https://docs.octobot.cloud/client-sdk/escape-hatches).\n\n## Compatibility\n\n| This package | `@drakkar.software/octobot-protocol` | Minimum node |\n|---|---|---|\n| `0.5.0` | `^0.6.0` | protocol 0.4.0 |\n\n## More\n\n- [Client SDK docs](https://docs.octobot.cloud/client-sdk/getting-started) — one topic per page,\n  start with Getting Started.\n- [`CHANGELOG.md`](CHANGELOG.md)\n- [Wire contract](https://docs.octobot.cloud/client-sdk/wire-contract) — every literal string shared\n  with the node's Python implementation, for anyone changing either side.\n","readmeFilename":"README.md"}