{"_id":"@ar.io/wayfinder-x402-fetch","_rev":"8-60f0b8e2ce9518709c5ed22b0f87f30e","name":"@ar.io/wayfinder-x402-fetch","dist-tags":{"alpha":"0.0.2-alpha.1","latest":"0.0.2"},"versions":{"0.0.1":{"name":"@ar.io/wayfinder-x402-fetch","version":"0.0.1","author":{"name":"Permanent Data Solutions Inc","email":"info@ar.io"},"_id":"@ar.io/wayfinder-x402-fetch@0.0.1","maintainers":[{"name":"fedellen","email":"derek@ardrive.io"},{"name":"ariel_at_ardrive","email":"ariel@ardrive.io"},{"name":"dylan-ario","email":"dylan@pds.inc"}],"homepage":"https://github.com/ar-io/wayfinder#readme","bugs":{"url":"https://github.com/ar-io/wayfinder/issues"},"dist":{"shasum":"77af8a127764006437880046f3c13b32a62d4163","tarball":"https://registry.npmjs.org/@ar.io/wayfinder-x402-fetch/-/wayfinder-x402-fetch-0.0.1.tgz","fileCount":6,"integrity":"sha512-tJkDOjrHDg2ROeTCV6arn3QvTkgczDwyF3EHp3FZ5nChFbLEIO1RPuqATb6i+OL27QB+6lSu5dNQGF1GwZteBg==","signatures":[{"sig":"MEUCIGw5TCW4XwxIspuW94FGyLrriSESIRsihJyEy4Kf+/QMAiEAjw5HCHBCott4mxTtVAOU8WlALHWdPWmzvJrreQmY+yY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17449},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20"},"gitHead":"5dff10ac8d66eb4fd7124b536a053ab18d1bc6a4","scripts":{"test":"npm run test:unit","build":"tsc","clean":"rimraf dist","lint:fix":"biome check --write --unsafe --config-path=../../biome.json","test:unit":"c8 tsx --test 'src/**/*.test.ts'","format:fix":"biome format --write --config-path=../../biome.json","lint:check":"biome check --unsafe --config-path=../../biome.json","format:check":"biome format --config-path=../../biome.json"},"_npmUser":{"name":"dylan-ario","email":"dylan@pds.inc"},"repository":{"url":"git+https://github.com/ar-io/wayfinder.git","type":"git"},"_npmVersion":"10.9.2","description":"x402-fetch integration for WayFinder","directories":{},"_nodeVersion":"22.14.0","dependencies":{"x402-fetch":"^0.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","viem":"^2.21.53","rimraf":"^6.0.1","typescript":"^5.7.2","@types/node":"^22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/wayfinder-x402-fetch_0.0.1_1762201829341_0.7524641246396815","host":"s3://npm-registry-packages-npm-production"}},"0.0.2-alpha.0":{"name":"@ar.io/wayfinder-x402-fetch","version":"0.0.2-alpha.0","author":{"name":"Permanent Data Solutions Inc","email":"info@ar.io"},"_id":"@ar.io/wayfinder-x402-fetch@0.0.2-alpha.0","maintainers":[{"name":"fedellen","email":"derek@ardrive.io"},{"name":"ariel_at_ardrive","email":"ariel@ardrive.io"},{"name":"dylan-ario","email":"dylan@pds.inc"}],"homepage":"https://github.com/ar-io/wayfinder#readme","bugs":{"url":"https://github.com/ar-io/wayfinder/issues"},"dist":{"shasum":"14f7a2a37a9ff8d1d749096fa7d6a2b71f57646c","tarball":"https://registry.npmjs.org/@ar.io/wayfinder-x402-fetch/-/wayfinder-x402-fetch-0.0.2-alpha.0.tgz","fileCount":6,"integrity":"sha512-njoGC9fAFbuqA+GGY1uosDBbhhpJv3VkmtudeL/Y22pLGGqPcNW7MnPgcvUFTCuTagQMl80WBWaMCS3NgtzWxw==","signatures":[{"sig":"MEUCIFw1jFN1xqhwHaafH+j/fbWhvD14JENVpjxrefBsL3bmAiEA0jSusX8SULoSVmD9LVH/LDCOhmlmLOQGITMNmIFOWc8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17457},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20"},"gitHead":"e850da9e0ddd3f813c12864d803eb3d3a0c7afe7","scripts":{"test":"npm run test:unit","build":"tsc","clean":"rimraf dist","lint:fix":"biome check --write --unsafe --config-path=../../biome.json","test:unit":"c8 tsx --test 'src/**/*.test.ts'","format:fix":"biome format --write --config-path=../../biome.json","lint:check":"biome check --unsafe --config-path=../../biome.json","format:check":"biome format --config-path=../../biome.json"},"_npmUser":{"name":"dylan-ario","email":"dylan@pds.inc"},"repository":{"url":"git+https://github.com/ar-io/wayfinder.git","type":"git"},"_npmVersion":"10.9.2","description":"x402-fetch integration for WayFinder","directories":{},"_nodeVersion":"22.14.0","dependencies":{"x402-fetch":"^0.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"^4.19.2","viem":"^2.21.53","rimraf":"^6.0.1","typescript":"^5.7.2","@types/node":"^22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/wayfinder-x402-fetch_0.0.2-alpha.0_1762263906491_0.9571269142442276","host":"s3://npm-registry-packages-npm-production"}},"0.0.2-alpha.1":{"name":"@ar.io/wayfinder-x402-fetch","version":"0.0.2-alpha.1","author":{"name":"Permanent Data Solutions Inc","email":"info@ar.io"},"_id":"@ar.io/wayfinder-x402-fetch@0.0.2-alpha.1","maintainers":[{"name":"fedellen","email":"derek@ardrive.io"},{"name":"ariel_at_ardrive","email":"ariel@ardrive.io"},{"name":"dylan-ario","email":"dylan@pds.inc"}],"homepage":"https://github.com/ar-io/wayfinder#readme","bugs":{"url":"https://github.com/ar-io/wayfinder/issues"},"dist":{"shasum":"66aeb1c11e7e7370d6574c3b625d337d767fc6ab","tarball":"https://registry.npmjs.org/@ar.io/wayfinder-x402-fetch/-/wayfinder-x402-fetch-0.0.2-alpha.1.tgz","fileCount":6,"integrity":"sha512-xaRZau2sZ0Xl7vuNUq8vBG2NvhvvfjZ4WP9xICmgB5cj4NAGGyHdYQxVtw533rQInLRjmuabeiYF3A/lZrG/HQ==","signatures":[{"sig":"MEQCIAD6tN2bRB5KZIU0YglemMRdrbnGyj4525Yg9+R6p/EoAiAA8vdyU+6KOSjEvXILeK2d2GRDCk3VjnWS6uhFsbp7yA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ar.io%2fwayfinder-x402-fetch@0.0.2-alpha.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":17457},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20"},"gitHead":"15014533faa80db49cdce55404cdc05369cbfe10","scripts":{"test":"npm run test:unit","build":"tsc","clean":"rimraf dist","lint:fix":"biome check --write --unsafe --config-path=../../biome.json","test:unit":"c8 tsx --test 'src/**/*.test.ts'","format:fix":"biome format --write --config-path=../../biome.json","lint:check":"biome check --unsafe --config-path=../../biome.json","format:check":"biome format --config-path=../../biome.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c15ccedf-d5f3-42e9-bd5a-d042c5ce5d2d"}},"repository":{"url":"git+https://github.com/ar-io/wayfinder.git","type":"git"},"_npmVersion":"11.6.1","description":"x402-fetch integration for WayFinder","directories":{},"_nodeVersion":"24.11.0","dependencies":{"x402-fetch":"^0.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"^4.19.2","viem":"^2.21.53","rimraf":"^6.0.1","typescript":"^5.7.2","@types/node":"^22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/wayfinder-x402-fetch_0.0.2-alpha.1_1762281866337_0.5707402054995685","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@ar.io/wayfinder-x402-fetch","version":"0.0.2","author":{"name":"Permanent Data Solutions Inc","email":"info@ar.io"},"_id":"@ar.io/wayfinder-x402-fetch@0.0.2","maintainers":[{"name":"fedellen","email":"derek@ardrive.io"},{"name":"ariel_at_ardrive","email":"ariel@ardrive.io"},{"name":"dylan-ario","email":"dylan@pds.inc"}],"homepage":"https://github.com/ar-io/wayfinder#readme","bugs":{"url":"https://github.com/ar-io/wayfinder/issues"},"dist":{"shasum":"061089884805b93d4a0950cece8cef6f7882d062","tarball":"https://registry.npmjs.org/@ar.io/wayfinder-x402-fetch/-/wayfinder-x402-fetch-0.0.2.tgz","fileCount":6,"integrity":"sha512-O2uVtRaFx20/9SjMPM9dQms4+98o7WqyuqJwG/wKK/+F7ZANBjrXMQfcVFRcrVwbq8X/l6s9MkPixhDThlg4iw==","signatures":[{"sig":"MEUCIDsO7uC7/DqVEsu75reprN2R+NaP+Q01lmlyfwT/Py/sAiEA5o7CHrD3F18vzlAulAxzXFVbPy+Ri+Xt6X6L55wwof8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ar.io%2fwayfinder-x402-fetch@0.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":17449},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20"},"gitHead":"e30ddf127f8b94d0ebb91c1ebd78259e10b750b6","scripts":{"test":"npm run test:unit","build":"tsc","clean":"rimraf dist","lint:fix":"biome check --write --unsafe --config-path=../../biome.json","test:unit":"c8 tsx --test 'src/**/*.test.ts'","format:fix":"biome format --write --config-path=../../biome.json","lint:check":"biome check --unsafe --config-path=../../biome.json","format:check":"biome format --config-path=../../biome.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c15ccedf-d5f3-42e9-bd5a-d042c5ce5d2d"}},"repository":{"url":"git+https://github.com/ar-io/wayfinder.git","type":"git"},"_npmVersion":"11.6.1","description":"x402-fetch integration for WayFinder","directories":{},"_nodeVersion":"24.11.0","dependencies":{"x402-fetch":"^0.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","viem":"^2.21.53","rimraf":"^6.0.1","typescript":"^5.7.2","@types/node":"^22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/wayfinder-x402-fetch_0.0.2_1762358182186_0.39635034908322075","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-11-03T20:30:29.289Z","modified":"2026-07-15T03:49:21.728Z","0.0.1":"2025-11-03T20:30:29.530Z","0.0.2-alpha.0":"2025-11-04T13:45:06.687Z","0.0.2-alpha.1":"2025-11-04T18:44:26.532Z","0.0.2":"2025-11-05T15:56:22.384Z"},"bugs":{"url":"https://github.com/ar-io/wayfinder/issues"},"author":{"name":"Permanent Data Solutions Inc","email":"info@ar.io"},"homepage":"https://github.com/ar-io/wayfinder#readme","repository":{"url":"git+https://github.com/ar-io/wayfinder.git","type":"git"},"description":"x402-fetch integration for WayFinder","maintainers":[{"email":"ariel@ardrive.io","name":"ariel_at_ardrive"},{"email":"info@ardrive.io","name":"vilenarios"},{"email":"atticusofsparta@protonmail.com","name":"atticusofsparta"}],"readme":"# wayfinder-x402-fetch\n\nA simple wrapper for [x402-fetch](https://github.com/ar-io/x402-fetch) that provides payment-aware fetch functionality for Wayfinder. This package handles 402 Payment Required responses automatically using the x402 protocol.\n\n## Installation\n\n```bash\nnpm install @ar.io/wayfinder-x402-fetch\n```\n\n## Usage\n\n### Basic Usage\n\n```typescript\nimport { createX402Fetch } from '@ar.io/wayfinder-x402-fetch';\nimport { Wayfinder } from '@ar.io/wayfinder-core';\n\n// Create a payment-enabled fetch function\nconst x402Fetch = createX402Fetch({\n  walletClient: myWalletClient, // Your x402-compatible wallet\n  fetch: globalThis.fetch, // Optional: custom fetch function\n  maxValue: 1000n // Optional: maximum payment amount\n});\n\n// Supply it to Wayfinder as the fetch implementation\nconst wayfinder = new Wayfinder({\n  fetch: x402Fetch,\n  verificationSettings: { enabled: false }\n});\n\n// Use normally - payments are handled automatically\nconst response = await wayfinder.request('ar://premium-content-txid');\n```\n\n## What This Package Does\n\nThis is a thin wrapper around x402-fetch that:\n\n1. Takes x402-fetch configuration\n2. Calls `wrapFetchWithPayment()` from x402-fetch\n3. Returns a fetch function compatible with Wayfinder\n\nThe returned function automatically handles:\n\n- 402 Payment Required responses\n- Payment credential generation\n- Request retry with payment headers\n\n## Configuration\n\nThe `createX402Fetch` function accepts:\n\n- `walletClient` (required): A Signer or MultiNetworkSigner from x402-fetch\n- `fetch` (optional): Custom fetch function to wrap (defaults to `globalThis.fetch`)\n- `maxValue` (optional): Maximum payment amount in wei\n\nFor detailed x402-fetch configuration options, see the [x402-fetch documentation](https://github.com/ar-io/x402-fetch).\n\n## Testing\n\nRun the tests to see x402-fetch integration in action:\n\n```bash\nnpm test\n```\n\nThis will demonstrate:\n\n- Regular fetch requests (non-402 responses)\n- 402 Payment Required handling with automatic payment\n- Payment rejection when exceeding maxValue limits\n\n## License\n\nLicensed under the Apache License, Version 2.0. See [LICENSE](../../LICENSE) for details.\n","readmeFilename":"README.md"}