{"_id":"@builtbyecho/vaultline-sdk","_rev":"2-8737204043c9a0173440657e5c0c28a5","name":"@builtbyecho/vaultline-sdk","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@builtbyecho/vaultline-sdk","version":"0.1.0","keywords":["vaultline","x402","sdk","base","usdc","agents","storage"],"author":{"name":"BuiltByEcho"},"license":"MIT","_id":"@builtbyecho/vaultline-sdk@0.1.0","maintainers":[{"name":"builtbyecho","email":"echo-token@agentmail.to"}],"homepage":"https://builtbyecho.xyz/#vaultline","bugs":{"url":"https://github.com/BuiltByEcho/vaultline/issues"},"dist":{"shasum":"14903c43d6786fa934ecc9b34199d844f23e16d1","tarball":"https://registry.npmjs.org/@builtbyecho/vaultline-sdk/-/vaultline-sdk-0.1.0.tgz","fileCount":22,"integrity":"sha512-jXDr0CqEMnY9019q0M1lrWSJtsZcAjosgd5G5gaLI3a41QhwedP2lvtukmlNVATQhLRFNyZIN/2/3wEyipxylw==","signatures":[{"sig":"MEUCIQCYxeAM1CvkdwMKXxAV1dAyuVD+YRiwe64Zpuy+aryfcgIgOgcRL3wvz/JiFWtzcfi1YkmP4lyf3B+vT5Ol0+Z+XaI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32995},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"e68c8f962e991e8c457bdd6e06f6d62e170b3171","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsc","prepublishOnly":"npm run lint && npm test && npm run build"},"_npmUser":{"name":"builtbyecho","email":"echo-token@agentmail.to"},"repository":{"url":"git+https://github.com/BuiltByEcho/vaultline.git","type":"git"},"_npmVersion":"11.12.1","description":"TypeScript SDK for Vaultline — x402-native file storage for agents with typed errors and request timeouts","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","dependencies":{"viem":"^2.28.0","@x402/evm":"^2.11.0","@x402/core":"^2.11.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.1.0","typescript":"^5.8.0"},"_npmOperationalInternal":{"tmp":"tmp/vaultline-sdk_0.1.0_1778688199120_0.4695638104885773","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@builtbyecho/vaultline-sdk","version":"0.1.1","description":"TypeScript SDK for Vaultline — x402-native file storage for agents with typed errors and request timeouts","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"sideEffects":false,"scripts":{"build":"tsc","lint":"tsc --noEmit","test":"vitest run","prepublishOnly":"npm run lint && npm test && npm run build"},"keywords":["vaultline","x402","sdk","base","usdc","agents","storage"],"author":{"name":"BuiltByEcho"},"license":"MIT","homepage":"https://builtbyecho.xyz/#vaultline","repository":{"type":"git","url":"git+https://github.com/BuiltByEcho/vaultline.git"},"bugs":{"url":"https://github.com/BuiltByEcho/vaultline/issues"},"engines":{"node":">=20"},"dependencies":{"@x402/core":"^2.11.0","@x402/evm":"^2.11.0","viem":"^2.28.0"},"devDependencies":{"typescript":"^5.8.0","vitest":"^3.1.0"},"gitHead":"d64659f5a5e26344a616c0d8bf0a3a982eb39dfc","_id":"@builtbyecho/vaultline-sdk@0.1.1","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-tp+JwObSo+NOjzdVnveGL8Wbal2C9MJySf7lsZJoBodlknoyy7aZ5ovj2m+menYHbmcufyS/EkAjNp/dStapyg==","shasum":"3dca94f5989759f29110e4d4d1d34e055a377335","tarball":"https://registry.npmjs.org/@builtbyecho/vaultline-sdk/-/vaultline-sdk-0.1.1.tgz","fileCount":22,"unpackedSize":39395,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA+hLzJJJCMMwT2STwtuUCG2Ossp4LrSPATIc4od8xV4AiEAsvtqSWc1KZhcG5XVCyMMTBZF/pOg+bhanZVoz2n7KUo="}]},"_npmUser":{"name":"builtbyecho","email":"echo-token@agentmail.to"},"directories":{},"maintainers":[{"name":"builtbyecho","email":"echo-token@agentmail.to"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vaultline-sdk_0.1.1_1778697354862_0.11948892709297265"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-13T16:03:18.958Z","modified":"2026-05-13T18:35:55.121Z","0.1.0":"2026-05-13T16:03:19.302Z","0.1.1":"2026-05-13T18:35:55.005Z"},"bugs":{"url":"https://github.com/BuiltByEcho/vaultline/issues"},"author":{"name":"BuiltByEcho"},"license":"MIT","homepage":"https://builtbyecho.xyz/#vaultline","keywords":["vaultline","x402","sdk","base","usdc","agents","storage"],"repository":{"type":"git","url":"git+https://github.com/BuiltByEcho/vaultline.git"},"description":"TypeScript SDK for Vaultline — x402-native file storage for agents with typed errors and request timeouts","maintainers":[{"name":"builtbyecho","email":"echo-token@agentmail.to"}],"readme":"# @builtbyecho/vaultline-sdk\n\nTypeScript SDK for **Vaultline** — x402-native storage rails for autonomous agents.\n\nLive API: `https://storage.builtbyecho.xyz`\n\nThis SDK removes the biggest friction points for developers:\n- x402 pay-and-retry handling\n- wallet-auth header creation for private storage\n- typed failures you can safely catch in agents and CLIs\n- default request timeouts so long-running agent workflows do not hang forever\n\n## Current status\n\nLive tiers supported by the SDK:\n- `open`\n- `private`\n\nPlanned later:\n- `encrypted` *(coming soon)*\n\n## Install\n\n```bash\nnpm install @builtbyecho/vaultline-sdk viem\n```\n\n## Quick start\n\n```ts\nimport { privateKeyToAccount } from 'viem/accounts';\nimport { VaultlineClient } from '@builtbyecho/vaultline-sdk';\n\nconst account = privateKeyToAccount(process.env.VAULTLINE_PAYER_PRIVATE_KEY as `0x${string}`);\n\nconst client = new VaultlineClient({\n  baseUrl: 'https://storage.builtbyecho.xyz',\n  account,\n  timeoutMs: 30_000,\n});\n```\n\n## Open upload\n\n```ts\nconst result = await client.upload('workspace/demo.txt', 'hello from sdk', {\n  contentType: 'text/plain',\n});\n\nconsole.log(result.data);\n```\n\n## Private upload\n\n```ts\nconst result = await client.upload('workspace/secret.txt', 'private notes', {\n  tier: 'private',\n  contentType: 'text/plain',\n  allowedWallets: ['0x1234567890123456789012345678901234567890'],\n});\n```\n\n## Private read\n\n```ts\nconst result = await client.downloadText('workspace/secret.txt', {\n  tier: 'private',\n});\n\nconsole.log(result.text);\n```\n\n\n## Share links\n\nCreate signed, expiring share links when another agent or human needs retrieval access without holding the owner wallet. Private files require owner/allowlisted wallet auth when creating the share.\n\n```ts\nconst share = await client.createShare('workspace/secret.txt', {\n  tier: 'private',\n  expiresInSeconds: 300,\n});\n\nconsole.log(share.data.url);\n\nconst shared = await client.downloadShareText(share.data.url);\nconsole.log(shared.text);\n```\n\n## Typed errors\n\nSDK helper methods throw `VaultlineError` for non-2xx responses after any x402 retry is complete. The parsed JSON/text response body is attached for logging, retries, and agent decision-making.\n\n```ts\nimport { VaultlineClient, VaultlineError } from '@builtbyecho/vaultline-sdk';\n\ntry {\n  await client.downloadText('workspace/missing.txt');\n} catch (error) {\n  if (error instanceof VaultlineError && error.status === 404) {\n    console.log('not found', error.body);\n  } else {\n    throw error;\n  }\n}\n```\n\n## Timeouts\n\nRequests default to a 30 second timeout using `AbortSignal.timeout`. Override per client, or pass `0` to disable.\n\n```ts\nconst client = new VaultlineClient({\n  baseUrl: 'https://storage.builtbyecho.xyz',\n  account,\n  timeoutMs: 10_000,\n});\n```\n\n## What the SDK handles automatically\n\n- `402 Payment Required` parsing\n- x402 payment payload creation\n- retry with payment headers\n- private-tier wallet auth headers\n- typed error creation with parsed response bodies\n- default request timeouts\n\n## Pricing notes\n\n- reads under `1 MB` are free\n- paid reads above the free threshold have a `$0.001` minimum to avoid dust-sized x402 payments\n- write and storage pricing are exposed by the live API metadata/routes\n\n## Notes\n\n- use `open` for shared/public-by-key files\n- use `private` for wallet-restricted files\n- do not treat `encrypted` as a live tier yet\n","readmeFilename":"README.md"}