{"_id":"@0xkey-io/http","_rev":"4-c8b5c8a1bf890f1d3c121d11227930b4","name":"@0xkey-io/http","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@0xkey-io/http","version":"0.1.0","keywords":["0xkey"],"author":{"url":"https://0xkey.com/","name":"0xkey"},"license":"Apache-2.0","_id":"@0xkey-io/http@0.1.0","maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/http","bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"dist":{"shasum":"7cf62517f2a46dc28f9ce0d26dda562d5c98b4ea","tarball":"https://registry.npmjs.org/@0xkey-io/http/-/http-0.1.0.tgz","fileCount":108,"integrity":"sha512-me37j2fkbx7zED8TJtU6vnhcHzDsg3Orc3s+8/U4spT2zJ4Zmi2lx2B0eb437Ei1nBLyZEQ7rRDxgPC6RGv+3A==","signatures":[{"sig":"MEYCIQC0DDPIplNMFx3jwcGAL3qaqBYgDEbbk53QtLgSCnrxiAIhAIJTfONLCS3teeKVqCG8kDyWU3ed7kqFGibI/hnZYsDQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9448160},"main":"./dist/index.js","_from":"file:0xkey-io-http-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"test":"jest","build":"rollup -c","clean":"rimraf ./dist ./.cache","version":"node -p \"'export const VERSION = ' + JSON.stringify(require('./package.json').name + '@' + require('./package.json').version) + ';'\" > src/version.ts","typecheck":"tsc -p tsconfig.typecheck.json"},"_npmUser":{"name":"0xkey-developer","email":"developer@0xkey.io"},"_resolved":"/private/var/folders/lf/b69416ms3zvccf0ght6bq02r0000gn/T/a9d1a7243839fcd75b3d7a4904fdb34c/0xkey-io-http-0.1.0.tgz","_integrity":"sha512-me37j2fkbx7zED8TJtU6vnhcHzDsg3Orc3s+8/U4spT2zJ4Zmi2lx2B0eb437Ei1nBLyZEQ7rRDxgPC6RGv+3A==","repository":{"url":"git+https://github.com/0xkey-io/sdk-js.git","type":"git","directory":"packages/http"},"_npmVersion":"11.4.2","description":"Typed HTTP client for interacting with 0xkey API","directories":{},"_nodeVersion":"24.3.0","dependencies":{"cross-fetch":"^3.1.5","@0xkey-io/encoding":"0.1.0","@0xkey-io/api-key-stamper":"0.1.0","@0xkey-io/webauthn-stamper":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/http_0.1.0_1779443525613_0.6768364006504797","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@0xkey-io/http","version":"0.1.1","keywords":["0xkey"],"author":{"url":"https://0xkey.com/","name":"0xkey"},"license":"Apache-2.0","_id":"@0xkey-io/http@0.1.1","maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/http","bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"dist":{"shasum":"81164862f0cd9eb35746f4fd49cbffa193280081","tarball":"https://registry.npmjs.org/@0xkey-io/http/-/http-0.1.1.tgz","fileCount":108,"integrity":"sha512-ejJxS6lhGFqtHUV/bss7ueEs68U6MSaw4FJ4LXzGG+5T8K2s2w9gYfPMuXYL9xWS/NpHg4yExt4ovRw+ol5bPA==","signatures":[{"sig":"MEUCIALj5VqvzLR1MrNYqMfqJiFcsTOzTLUy0LHtGKYQVmoCAiEAi8CES2RvWJ1D+d3VFL6fVoZgxppWeQ0nGkSUdfOYTfQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9448282},"main":"./dist/index.js","_from":"file:0xkey-io-http-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"test":"jest","build":"rollup -c","clean":"rimraf ./dist ./.cache","version":"node -p \"'export const VERSION = ' + JSON.stringify(require('./package.json').name + '@' + require('./package.json').version) + ';'\" > src/version.ts","typecheck":"tsc -p tsconfig.typecheck.json"},"_npmUser":{"name":"0xkey-developer","email":"developer@0xkey.io"},"_resolved":"/private/var/folders/lf/b69416ms3zvccf0ght6bq02r0000gn/T/4650a63e8a895deacb64831521c47d6f/0xkey-io-http-0.1.1.tgz","_integrity":"sha512-ejJxS6lhGFqtHUV/bss7ueEs68U6MSaw4FJ4LXzGG+5T8K2s2w9gYfPMuXYL9xWS/NpHg4yExt4ovRw+ol5bPA==","repository":{"url":"git+https://github.com/0xkey-io/sdk-js.git","type":"git","directory":"packages/http"},"_npmVersion":"11.4.2","description":"Typed HTTP client for interacting with 0xkey API","directories":{},"_nodeVersion":"24.3.0","dependencies":{"cross-fetch":"^3.1.5","@0xkey-io/encoding":"0.1.1","@0xkey-io/api-key-stamper":"0.1.1","@0xkey-io/webauthn-stamper":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/http_0.1.1_1779451989244_0.1728725804523037","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@0xkey-io/http","version":"0.1.2","keywords":["0xkey"],"author":{"url":"https://0xkey.com/","name":"0xkey"},"license":"Apache-2.0","_id":"@0xkey-io/http@0.1.2","maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/http","bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"dist":{"shasum":"ad227044bcd6ed05468dfc51ca675505f3c2b9b2","tarball":"https://registry.npmjs.org/@0xkey-io/http/-/http-0.1.2.tgz","fileCount":108,"integrity":"sha512-ZSqHd1T3y9hrH7mz+GTwVezJCnxD1DvV+xy/oJ260MvGGnfUNfe4+G0ZkTMy553yO9ar3Xdn3mUOruhIA27FWw==","signatures":[{"sig":"MEUCIQCfE+n3kF66hfBQgubT4e37Njzc02xdrBlbpGI46Wt4XgIgAh7NCuvNs3IQMIZuMUTrFulmqbWWkyomhb8JFo0Nzqo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9448372},"main":"./dist/index.js","_from":"file:0xkey-io-http-0.1.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"test":"jest","build":"rollup -c","clean":"rimraf ./dist ./.cache","version":"node -p \"'export const VERSION = ' + JSON.stringify(require('./package.json').name + '@' + require('./package.json').version) + ';'\" > src/version.ts","typecheck":"tsc -p tsconfig.typecheck.json"},"_npmUser":{"name":"0xkey-developer","email":"developer@0xkey.io"},"_resolved":"/tmp/aa4cba06e230fd371a43484364c60be7/0xkey-io-http-0.1.2.tgz","_integrity":"sha512-ZSqHd1T3y9hrH7mz+GTwVezJCnxD1DvV+xy/oJ260MvGGnfUNfe4+G0ZkTMy553yO9ar3Xdn3mUOruhIA27FWw==","repository":{"url":"git+https://github.com/0xkey-io/sdk-js.git","type":"git","directory":"packages/http"},"_npmVersion":"11.5.1","description":"Typed HTTP client for interacting with 0xkey API","directories":{},"_nodeVersion":"20.17.0","dependencies":{"cross-fetch":"^3.1.5","@0xkey-io/encoding":"0.1.1","@0xkey-io/api-key-stamper":"0.1.2","@0xkey-io/webauthn-stamper":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/http_0.1.2_1782244103841_0.6967910012716856","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@0xkey-io/http","version":"0.1.3","main":"./dist/index.js","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js","default":"./dist/index.mjs"}},"types":"./dist/index.d.ts","license":"Apache-2.0","description":"Typed HTTP client for interacting with 0xkey API","keywords":["0xkey"],"author":{"name":"0xkey","url":"https://0xkey.com/"},"homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/http","bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"repository":{"type":"git","url":"git+https://github.com/0xkey-io/sdk-js.git","directory":"packages/http"},"publishConfig":{"access":"public"},"dependencies":{"cross-fetch":"^3.1.5","@0xkey-io/api-key-stamper":"0.1.3","@0xkey-io/encoding":"0.1.1","@0xkey-io/webauthn-stamper":"0.1.0"},"engines":{"node":">=18.0.0"},"scripts":{"version":"node -p \"'export const VERSION = ' + JSON.stringify(require('./package.json').name + '@' + require('./package.json').version) + ';'\" > src/version.ts","build":"rollup -c","clean":"rimraf ./dist ./.cache","test":"jest","typecheck":"tsc -p tsconfig.typecheck.json"},"_id":"@0xkey-io/http@0.1.3","_integrity":"sha512-gitSGSWzcHFcN4ousgQ+cIZ/OJNE7I0suPrJZSRM/iGYlaQDAUSGxWrnT4PcgwDOi+wCyI2CpQYnqi+J8h9VFA==","_resolved":"/tmp/633f9160422585f10ccb33af4ff002ac/0xkey-io-http-0.1.3.tgz","_from":"file:0xkey-io-http-0.1.3.tgz","_nodeVersion":"20.17.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-gitSGSWzcHFcN4ousgQ+cIZ/OJNE7I0suPrJZSRM/iGYlaQDAUSGxWrnT4PcgwDOi+wCyI2CpQYnqi+J8h9VFA==","shasum":"6435e72c90a7088108a9856116f36461f5b86fdd","tarball":"https://registry.npmjs.org/@0xkey-io/http/-/http-0.1.3.tgz","fileCount":108,"unpackedSize":9448465,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD7gnB1PvUOZCdKdtBxlntZDOju6flpxu5CPMZLFxsD2wIgFxMgN9ghaJDh+a/tJGtXQR8KHfY00bixyCNY+7cfpLE="}]},"_npmUser":{"name":"0xkey-developer","email":"developer@0xkey.io"},"directories":{},"maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/http_0.1.3_1783079765312_0.33944388735078523"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-22T09:52:05.469Z","modified":"2026-07-03T11:56:05.604Z","0.1.0":"2026-05-22T09:52:05.841Z","0.1.1":"2026-05-22T12:13:09.495Z","0.1.2":"2026-06-23T19:48:24.040Z","0.1.3":"2026-07-03T11:56:05.482Z"},"bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"author":{"name":"0xkey","url":"https://0xkey.com/"},"license":"Apache-2.0","homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/http","keywords":["0xkey"],"repository":{"type":"git","url":"git+https://github.com/0xkey-io/sdk-js.git","directory":"packages/http"},"description":"Typed HTTP client for interacting with 0xkey API","maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"readme":"# @0xkey-io/http\n\n[![npm](https://img.shields.io/npm/v/@0xkey-io/http?color=%234C48FF)](https://www.npmjs.com/package/@0xkey-io/http)\n\nA lower-level, fully typed HTTP client for interacting with [ZeroXKey](https://0xkey.com) API.\n\nFor signing transactions and messages, check out the higher-level [`@0xkey-io/ethers`](https://www.npmjs.com/package/@0xkey-io/ethers) or [`@0xkey-io/viem`](https://www.npmjs.com/package/@0xkey-io/viem) signers.\n\nZeroXKey API documentation lives here: https://docs.0xkey.com.\n\n## Getting started\n\n```bash\n$ npm install @0xkey-io/http\n```\n\n```typescript\nimport { ApiKeyStamper } from \"@0xkey-io/api-key-stamper\";\nimport { ZeroXKeyClient } from \"@0xkey-io/http\";\n\n// This stamper produces signatures using the API key pair passed in.\nconst stamper = new ApiKeyStamper({\n  apiPublicKey: \"...\",\n  apiPrivateKey: \"...\",\n});\n\n// The ZeroXKey client uses the passed in stamper to produce signed requests\n// and sends them to ZeroXKey\nconst client = new ZeroXKeyClient(\n  {\n    baseUrl: \"https://api.0xkey.com\",\n  },\n  stamper,\n);\n\n// Now you can make authenticated requests!\nconst data = await client.getWhoami({\n  organizationId: \"<Your organization id>\",\n});\n```\n\n## HTTP fetchers\n\n`@0xkey-io/http` provides fully typed http fetchers for interacting with the ZeroXKey API. You can find all available methods [here](/packages/http/src/__generated__/services/coordinator/public/v1/public_api.fetcher.ts). The types of input parameters and output responses are also exported for convenience.\n\nThe OpenAPI spec that generates all fetchers is also [included](/packages/http/src/__generated__/services/coordinator/public/v1/public_api.swagger.json) in the package.\n\n## `withAsyncPolling(...)` helper\n\nAll ZeroXKey mutation endpoints are asynchronous (with the exception of private key-related signing endpoints, e.g. `/submit/sign_transaction`, `/submit/sign_raw_payload`). To help you simplify async mutations, `@0xkey-io/http` provides a `withAsyncPolling(...)` wrapper. Here's a quick example:\n\n```typescript\nimport { withAsyncPolling, ZeroXKeyActivityError } from \"@0xkey-io/http\";\n\n// Use `withAsyncPolling(...)` to wrap & create a fetcher with built-in async polling support\nconst fetcher = withAsyncPolling({\n  request: client.createPrivateKeys,\n});\n\n// The fetcher remains fully typed. After submitting the request,\n// it'll poll until the activity reaches a terminal state.\ntry {\n  const activity = await fetcher({\n    body: {\n      /* ... */\n    },\n  });\n\n  // Success!\n  console.log(\n    activity.result.createPrivateKeysResultV2?.privateKeys?.[0]?.privateKeyId,\n  );\n} catch (error) {\n  if (error instanceof ZeroXKeyActivityError) {\n    // In case the activity is rejected, failed, or requires consensus,\n    // a rich `ZeroXKeyActivityError` will be thrown. You can read from\n    // `ZeroXKeyActivityError` to find out why the activity didn't succeed.\n    //\n    // For instance, if your activity requires consensus and doesn't have\n    // enough approvals, you can get the `activityId` from `ZeroXKeyActivityError`,\n    // store it somewhere, then re-fetch the activity via `.postGetActivity(...)`\n    // when the required approvals/rejections are in place.\n  }\n}\n```\n\n## More examples\n\nSee [`createNewEthereumPrivateKey.ts`](/examples/with-ethers/src/createNewEthereumPrivateKey.ts) in the [`with-ethers`](/examples/with-ethers/) example.\n\n## See also\n\n- [`@0xkey-io/ethers`](https://www.npmjs.com/package/@0xkey-io/ethers): ZeroXKey Signer for [`Ethers`](https://docs.ethers.org/v6/api/providers/#Signer)\n- [`@0xkey-io/viem`](https://www.npmjs.com/package/@0xkey-io/viem): ZeroXKey Custom Account for [`Viem`](https://viem.sh/docs/accounts/custom.html)\n","readmeFilename":"README.md"}