{"_id":"0g-kit","_rev":"10-691aeb218b63cae1868e25a7c0674597","name":"0g-kit","dist-tags":{"latest":"1.0.9"},"versions":{"1.0.0":{"name":"0g-kit","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"0g-kit@1.0.0","maintainers":[{"name":"notmartin","email":"mandatedisrael@gmail.com"}],"dist":{"shasum":"abf8fb80b91dd71cd5bd23b2cc2d0dff2defd0d4","tarball":"https://registry.npmjs.org/0g-kit/-/0g-kit-1.0.0.tgz","fileCount":27,"integrity":"sha512-4VvmLdfulho99R5y+qAP7bZXbKlEiFd9vaKNo/YVGH4L0J4QSlj8cq0liSwFZaZ6O2GBhbIS85eRpgE07b27hQ==","signatures":[{"sig":"MEQCIHoOcSJx3PfXda7qr6iQU0810m2FDrvi66WHXQMLdfD7AiA8d48yPq6anUtCmbmgX6RcAw4zbss8zwc0UCcJYLhZnw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":123762},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"5c2b222f302b7313bf6f9695bdaa10e87a5699f9","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc"},"_npmUser":{"name":"notmartin","email":"mandatedisrael@gmail.com"},"_npmVersion":"10.9.2","description":"A simple 2 liner for integrating any 0G infrastructure","directories":{},"_nodeVersion":"22.14.0","dependencies":{"ethers":"^6.13.1","@0glabs/0g-serving-broker":"^0.3.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/0g-kit_1.0.0_1755246714933_0.011568690566683637","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"0g-kit","version":"1.0.1","keywords":[],"author":"","license":"ISC","_id":"0g-kit@1.0.1","maintainers":[{"name":"notmartin","email":"mandatedisrael@gmail.com"}],"dist":{"shasum":"99561c64a8cd3f8d9d97be0b78a28a90394623c0","tarball":"https://registry.npmjs.org/0g-kit/-/0g-kit-1.0.1.tgz","fileCount":27,"integrity":"sha512-jwLKlQ92oMaBxThUwDOJip1VymQDj/CEAZapMVt0/w8DuWVeP2eYDyvNRWZh7x75UWN3Rznq4un7UNn2pZQNsg==","signatures":[{"sig":"MEQCIFTDWqjZ8OIkoIvJuJIHSgNmzHqNgQHuXFHlk1pz8rv1AiAPsq93fafMWPrbxrHwhGpxaM2gv0RataxEt1n55GoS9g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":123796},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"81395020fad2da6810d5b0ccb5096790dbf7a545","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc"},"_npmUser":{"name":"notmartin","email":"mandatedisrael@gmail.com"},"_npmVersion":"10.9.2","description":"A simple 2 liner for integrating any 0G infrastructure","directories":{},"_nodeVersion":"22.14.0","dependencies":{"ethers":"^6.13.1","@0glabs/0g-serving-broker":"^0.3.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/0g-kit_1.0.1_1755247687825_0.22219627855520074","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"0g-kit","version":"1.0.2","keywords":[],"author":{"url":"https://x.com/Damiclone","name":"notMartin","email":"mandatedisrael@gmail.com"},"license":"ISC","_id":"0g-kit@1.0.2","maintainers":[{"name":"notmartin","email":"mandatedisrael@gmail.com"}],"dist":{"shasum":"9aebbb562d48604676244b651a50f8c0e8064344","tarball":"https://registry.npmjs.org/0g-kit/-/0g-kit-1.0.2.tgz","fileCount":27,"integrity":"sha512-HxaHle8/kYraoa/1B9rhOFHAFlM0DeTpEYGdBgUjIdptf7J67tBQ1r+YZ0/m6aw/fLcfIOD/5tpSBjqBR1kxng==","signatures":[{"sig":"MEQCIGvKOZCG3I0wrWLKAXoFZ9QYrNaXqdPTVtSLdz/tgqybAiB9KBRS6odOBA96OAB1CdU0hUUkgcOIWWqA6UFVsqFziw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127373},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"a64ef4eb6f4ee471d5041013c5a21db228359e5f","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc"},"_npmUser":{"name":"notmartin","email":"mandatedisrael@gmail.com"},"_npmVersion":"10.9.2","description":"A simple 2 liner for integrating any 0G infrastructure","directories":{},"_nodeVersion":"22.14.0","dependencies":{"ethers":"^6.13.1","@0glabs/0g-serving-broker":"^0.3.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/0g-kit_1.0.2_1755463821253_0.2558367057750386","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"0g-kit","version":"1.0.3","keywords":[],"author":{"url":"https://x.com/Damiclone","name":"notMartin","email":"mandatedisrael@gmail.com"},"license":"ISC","_id":"0g-kit@1.0.3","maintainers":[{"name":"notmartin","email":"mandatedisrael@gmail.com"}],"dist":{"shasum":"01d736f74e9cecd6e836eb7363a2868cd6c35373","tarball":"https://registry.npmjs.org/0g-kit/-/0g-kit-1.0.3.tgz","fileCount":27,"integrity":"sha512-rA9OV8hKmZIRuvwcMH2lVY1K0t0vfhmFtIZqo5YU32LOEb7IypQQiV6+BSrlGNw9H/sCYmvPlVsd9+W9QIBCnw==","signatures":[{"sig":"MEYCIQCBvytxTLSEi9PaupRrnOmSG5MNh+MXuQBlwhN7lcMA4gIhALzpK6qlzpxFx35IMW34+YH7nSQ8t9dUlpAZM4wwuwaS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":126619},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"13604cbb9ee68540f02dc1f70ef734f894ddd2b2","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc"},"_npmUser":{"name":"notmartin","email":"mandatedisrael@gmail.com"},"_npmVersion":"10.9.2","description":"A simple 2 liner for integrating any 0G infrastructure","directories":{},"_nodeVersion":"22.14.0","dependencies":{"ethers":"^6.13.1","@0glabs/0g-serving-broker":"^0.3.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/0g-kit_1.0.3_1755465142732_0.6048494583874293","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"0g-kit","version":"1.0.4","keywords":[],"author":{"url":"https://x.com/Damiclone","name":"notMartin","email":"mandatedisrael@gmail.com"},"license":"ISC","_id":"0g-kit@1.0.4","maintainers":[{"name":"notmartin","email":"mandatedisrael@gmail.com"}],"dist":{"shasum":"21663145a46ee7d15699ab63effe8d685328dfec","tarball":"https://registry.npmjs.org/0g-kit/-/0g-kit-1.0.4.tgz","fileCount":27,"integrity":"sha512-2zDwCr38zECtXPTLgS3cRD3FJVzWTJFXyeVOH1CXUVmY+VJUlazTOMC2VtMHWotS1jZdtqjhei8xqSlsFJ0dkA==","signatures":[{"sig":"MEUCIQDrEdZS0iSE9icDCOZOa88zJJfj0M8i/4tIZQJe+phSQwIgBIcYJgKLBBJfiHikMZu5yQEAB1ws6zVKwA5TYAue8/s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":128545},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"44e7a999d16880ecdc1e71c194dd9c9065d09542","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc"},"_npmUser":{"name":"notmartin","email":"mandatedisrael@gmail.com"},"_npmVersion":"10.9.2","description":"A simple 2 liner for integrating any 0G infrastructure","directories":{},"_nodeVersion":"22.14.0","dependencies":{"ethers":"^6.13.1","@0glabs/0g-serving-broker":"^0.3.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/0g-kit_1.0.4_1755558723352_0.7794811570032643","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"0g-kit","version":"1.0.5","keywords":[],"author":{"url":"https://x.com/Damiclone","name":"notMartin","email":"mandatedisrael@gmail.com"},"license":"ISC","_id":"0g-kit@1.0.5","maintainers":[{"name":"notmartin","email":"mandatedisrael@gmail.com"}],"dist":{"shasum":"fdff357147b839732759eb66b1d9c78b1486ec3a","tarball":"https://registry.npmjs.org/0g-kit/-/0g-kit-1.0.5.tgz","fileCount":27,"integrity":"sha512-jR1O+56bbSPGSLWaQ2aaBjbaz3h4Ro8XFCGlVBJdupcakKdq3gTlUQTjQK5mc7lsGw/On2oNWZlKMrXvd5CO9w==","signatures":[{"sig":"MEQCIAxwoO0jLt3CZNi15gNaJGfC8RS/MMlTTKMPb4SkHtzcAiBDUGOnk1CJbkuI4D+Rg+pfV6GPwGQuMeyB9qyIHgxFFw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":128057},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"4df98de323b1eadeb95dcf57911e2ba4f94e64dc","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc"},"_npmUser":{"name":"notmartin","email":"mandatedisrael@gmail.com"},"_npmVersion":"10.9.2","description":"A simple 2 liner for integrating any 0G infrastructure","directories":{},"_nodeVersion":"22.14.0","dependencies":{"ethers":"^6.13.1","@0glabs/0g-serving-broker":"^0.3.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/0g-kit_1.0.5_1755565671331_0.2111043575365017","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"0g-kit","version":"1.0.6","keywords":[],"author":{"url":"https://x.com/Damiclone","name":"notMartin","email":"mandatedisrael@gmail.com"},"license":"ISC","_id":"0g-kit@1.0.6","maintainers":[{"name":"notmartin","email":"mandatedisrael@gmail.com"}],"dist":{"shasum":"4cc5198ad7f480d13bbebd9336549f08c3eb9fc5","tarball":"https://registry.npmjs.org/0g-kit/-/0g-kit-1.0.6.tgz","fileCount":31,"integrity":"sha512-v39wmd+lHjk+s3fTlMZfesQBIi7B3qTb7Be2Ssl7ScTNcgLMou2Tqs4aZtqrgvalcgv5pE+TYNtdhQ0w99i75Q==","signatures":[{"sig":"MEUCIQCt4TVpOtr2DLIKvcM+pC7aUatWMe4ACLHlHT7KQFgTPwIgeMR8eFihgY8B+6ejMO2rG7U6rS4rGTxTONiOKSTopPE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":178027},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":"./dist/index.js","./storage":"./dist/core/storage-functions.js"},"gitHead":"d07cc2e3fee24b6610905e9bb95d0e16a20f2e76","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc"},"_npmUser":{"name":"notmartin","email":"mandatedisrael@gmail.com"},"_npmVersion":"10.9.2","description":"A simple 2 liner for integrating any 0G infrastructure","directories":{},"_nodeVersion":"22.14.0","dependencies":{"ethers":"^6.15.0","@0glabs/0g-ts-sdk":"^0.3.1","@0glabs/0g-serving-broker":"^0.3.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.5"},"_npmOperationalInternal":{"tmp":"tmp/0g-kit_1.0.6_1756792780241_0.38487693961861","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"0g-kit","version":"1.0.7","keywords":[],"author":{"url":"https://x.com/Damiclone","name":"notMartin","email":"mandatedisrael@gmail.com"},"license":"ISC","_id":"0g-kit@1.0.7","maintainers":[{"name":"notmartin","email":"mandatedisrael@gmail.com"}],"dist":{"shasum":"1182d685dfa6be96c9f64b930bb80cd68b2fac5d","tarball":"https://registry.npmjs.org/0g-kit/-/0g-kit-1.0.7.tgz","fileCount":31,"integrity":"sha512-bj2UY8+rj3ItGCdRQvYakDArT55EmIxinc9YCEQ2b/ZAFP65EmQn0YjEsIhcwqa+rceB4AeXf2Em3fUYzq2bHQ==","signatures":[{"sig":"MEUCIQD3hQIySgZ+gez5BFtq+kpN88yLMLgQIC178YJEejfsYwIgcvcgMfelG5sBV05BlYOMvUE5DO3J+gzkNNaNBIznBDc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":184165},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":"./dist/index.js","./storage":"./dist/core/storage-functions.js"},"gitHead":"dad8c2176ab3888dba961eb8d841ecd060fdf89c","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc"},"_npmUser":{"name":"notmartin","email":"mandatedisrael@gmail.com"},"_npmVersion":"10.9.2","description":"A simple 2 liner for integrating any 0G infrastructure","directories":{},"_nodeVersion":"22.14.0","dependencies":{"ethers":"^6.15.0","@0glabs/0g-ts-sdk":"^0.3.1","@0glabs/0g-serving-broker":"^0.3.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.5"},"_npmOperationalInternal":{"tmp":"tmp/0g-kit_1.0.7_1756805849052_0.9288240791294124","host":"s3://npm-registry-packages-npm-production"}},"1.0.8":{"name":"0g-kit","version":"1.0.8","keywords":[],"author":{"url":"https://x.com/Damiclone","name":"notMartin","email":"mandatedisrael@gmail.com"},"license":"ISC","_id":"0g-kit@1.0.8","maintainers":[{"name":"notmartin","email":"mandatedisrael@gmail.com"}],"dist":{"shasum":"5af1510e21fac20bf1ae4003f72d39e63d740635","tarball":"https://registry.npmjs.org/0g-kit/-/0g-kit-1.0.8.tgz","fileCount":31,"integrity":"sha512-fzUshtQPmnLd0ZjAuxi+mEuIwEVSk3Qyu7M1iZDPufAC3vZlpVRf7ZDU5wn7Q3MIQyje0Jjku0NfH87XWM3F7A==","signatures":[{"sig":"MEUCIQDjXY6w92SiHWyHkB4mS0t7q8hI07yd4eeJQJePj1pe8AIgdu3DtV8/dZyNnOPiQA3XXLLPLmhsMx3RtkPRWSLsc1Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":184192},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":"./dist/index.js","./storage":"./dist/core/storage-functions.js"},"gitHead":"2b3e96c9259f93ba8c2a026cd3995a6cea409626","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc"},"_npmUser":{"name":"notmartin","email":"mandatedisrael@gmail.com"},"_npmVersion":"10.9.2","description":"A simple 2 liner for integrating any 0G infrastructure","directories":{},"_nodeVersion":"22.14.0","dependencies":{"ethers":"^6.13.1","node-fetch":"^3.3.2","@0glabs/0g-ts-sdk":"^0.3.3","@0glabs/0g-serving-broker":"^0.6.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.6"},"_npmOperationalInternal":{"tmp":"tmp/0g-kit_1.0.8_1764607211122_0.9229465720799757","host":"s3://npm-registry-packages-npm-production"}},"1.0.9":{"name":"0g-kit","version":"1.0.9","description":"A simple 2 liner for integrating any 0G infrastructure","type":"module","types":"dist/index.d.ts","main":"dist/index.js","scripts":{"build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"license":"ISC","dependencies":{"@0glabs/0g-serving-broker":"^0.7.1","@0glabs/0g-ts-sdk":"^0.3.3","ethers":"^6.16.0","node-fetch":"^3.3.2"},"exports":{".":"./dist/index.js","./storage":"./dist/core/storage-functions.js"},"author":{"name":"notMartin","email":"mandatedisrael@gmail.com","url":"https://x.com/Damiclone"},"devDependencies":{"tsx":"^4.20.6"},"_id":"0g-kit@1.0.9","gitHead":"a5f5565c6a37cccd166de3bdd91df11937fd6dbe","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-EIxbi2j1n9utV4TPKZ4unjyX7ayFBqAR6uvZ3Fjet2f+CsHvqTHYkLPmNoyqBkk77AFnGvKRJtzyrCeWreJzvQ==","shasum":"bd1f4a37ee8180e4286eaf3cf6ad6bd49eb7bcd4","tarball":"https://registry.npmjs.org/0g-kit/-/0g-kit-1.0.9.tgz","fileCount":31,"unpackedSize":184192,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA+XFPz/4mBvIpG7xq5zbpaL7HnavRNhKFDub1AsTiEFAiEAt6OBKjKmldSMVwlvTzzEWfmpfBIs7O/b2/Q/J5uOpi4="}]},"_npmUser":{"name":"notmartin","email":"mandatedisrael@gmail.com"},"directories":{},"maintainers":[{"name":"notmartin","email":"mandatedisrael@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/0g-kit_1.0.9_1772183618696_0.10451015870426139"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-15T08:31:54.932Z","modified":"2026-02-27T09:13:38.960Z","1.0.0":"2025-08-15T08:31:55.102Z","1.0.1":"2025-08-15T08:48:08.030Z","1.0.2":"2025-08-17T20:50:21.426Z","1.0.3":"2025-08-17T21:12:22.934Z","1.0.4":"2025-08-18T23:12:03.558Z","1.0.5":"2025-08-19T01:07:51.532Z","1.0.6":"2025-09-02T05:59:40.438Z","1.0.7":"2025-09-02T09:37:29.234Z","1.0.8":"2025-12-01T16:40:11.322Z","1.0.9":"2026-02-27T09:13:38.847Z"},"author":{"name":"notMartin","email":"mandatedisrael@gmail.com","url":"https://x.com/Damiclone"},"license":"ISC","keywords":[],"description":"A simple 2 liner for integrating any 0G infrastructure","maintainers":[{"name":"notmartin","email":"mandatedisrael@gmail.com"}],"readme":"# 0G Kit - Simplified SDK for easy integration!\n\nA developer-friendly SDK that makes it easy to interact with the 0G decentralized AI network. Go from multiple lines of complex setup to just 2 lines of code and get any 0G infrastructure integrated into your app!\n\n## What Complexity Does 0G Kit Handle For You? \n\nThe 0G Kit abstracts away the following complex technical details:\n\n### 🧠 **0G Compute Network**\n• **Broker Initialization** - No need to manually create and configure the 0G Compute Network broker with ethers.js providers, wallets etc\n\n• **Provider Discovery** - Automatic service discovery and provider selection instead of manually calling `broker.inference.listService()`\n\n• **Provider Acknowledgment** - Automatic on-chain provider acknowledgment via `broker.inference.acknowledgeProviderSigner()`\n\n• **Service Metadata Retrieval** - No need to manually fetch endpoint and model information with `broker.inference.getServiceMetadata()`\n\n• **Request Header Generation** - Automatic generation of single-use authenticated headers via `broker.inference.getRequestHeaders()`\n\n• **HTTP Request Management** - Handles all the fetch API calls, error handling, and response parsing\n\n• **Response Verification** - Automatic response processing and verification for TEE-enabled services\n\n• **Fee Settlement** - Automatic micropayment handling and fee settlement\n\n• **Account Management** - Simplified balance checking, deposits, and withdrawals without direct ledger interactions\n\n• **Error Handling** - Comprehensive error handling for network issues, insufficient funds, and provider failures\n\n• **Retry Logic** - Built-in retry mechanisms for failed requests\n\n• **Timeout Management** - Automatic request timeout handling and cleanup\n\n### 💾 **0G Storage Network**\n• **Indexer Initialization** - No need to manually create and configure the 0G Storage indexer with ethers.js providers, wallets etc\n\n• **File Processing** - Automatic file handling, Merkle tree generation, and buffer management\n\n• **Upload Management** - Handles all upload operations, transaction signing, and blockchain interactions\n\n• **Download Management** - Automatic file retrieval and verification using root hashes\n\n• **Gas Management** - Automatic gas price optimization (5x default) and transaction fee handling\n\n• **Error Handling** - Comprehensive error handling for network issues, file operations, and blockchain failures\n\n• **Retry Logic** - Built-in retry mechanisms for failed uploads/downloads\n\n• **Timeout Management** - Automatic operation timeout handling and cleanup\n\n-------\n\n## What You Get With 0G Kit\n**TLDR;**\n- ✅ **Simple 2-line setup** - instant and easy integration into any project!\n- ✅ **Automatic retries** - Built-in resilience for network issues\n- ✅ **Balance management** - Easy deposit/withdraw operations without worrying about the technicalities\n- ✅ **Multiple AI models** - Support for All providers on 0G inference!\n- ✅ **Decentralized storage** - Simple file upload/download with just 2-3 lines of code!\n- ✅ **Key-Value storage** - Easy KV operations with 2-line setup!\n- ✅ **Stream storage** - Efficient streaming for large files!\n- ✅ **Custom gas control** - Fine-tuned gas price management for uploads\n- ✅ **TypeScript support** - Full type definitions included\n- ✅ **Error handling** - Clear, actionable error messages\n- ✅ **Logging** - Configurable logging for debugging\n- ✅ **Timeout protection** - Prevents hanging requests\n\n## Installation\n\n- Install 0G kit `npm install 0g-kit`\n- Get some 0G faucet from [Link](https://faucet.0g.ai/)\n- Add your EVM private key to .env ( PRIVATE_KEY )\n\n> ⚠️ **Important**: For first time usage, it automatically deposits 0.05 OG to activate your broker account. Subsequent calls won't auto-deposit unless you explicitly call the deposit function!\n\n## Import Options\n\n```javascript\n\n// Compute-only imports  \nimport { chat, useDeepseek, useLlama, useQwen } from '0g-kit';\n\n// Storage-only imports\nimport { uploadFile, downloadFile, uploadFileWithGas, uploadKeyValueFile, downloadKeyValueFile, uploadStream, downloadStream } from '0g-kit/storage';\n```\n\n---\n\n# 🧠 0G Compute Network\n\n## Basic Usage (2 lines!)\n\n```javascript\n// AI Chat\nimport { chat } from '0g-kit';\nconst response = await chat('Hello, how are you?');\n```\n\n## Model-Specific Functions\n\n```javascript\n// Use DeepSeek model specifically\nimport { useDeepseek } from '0g-kit';\nconst response = await useDeepseek('Hello, how are you?')\n```\n\n```javascript\n// Use Llama model specifically\nimport { useLlama } from '0g-kit';\nconst response = await useLlama('Hello, how are you?')\n```\n\n```javascript\n// Use Qwen model specifically\nimport { useQwen } from '0g-kit';\nconst response = await useQwen('Hello, how are you?')\n```\n\n## Service Discovery\n\n```javascript\n// Get list of available models and providers\nimport { getAvailableModels } from '0g-kit';\nawait getAvailableModels().then(console.log());\n```\n\n```javascript\n// Get detailed service information\nimport { listServices } from '0g-kit';\nawait listServices().then(console.log());\n```\n\n## Manage Your Balance\n\n```javascript\n// Check balance\nimport { getBalance } from '0g-kit';\nawait getBalance().then(console.log());\n```\n\n```javascript\n// Deposit 0.5 0G from wallet to broker account\nimport { deposit } from '0g-kit';\nawait deposit(0.5); \n```\n\n```javascript\n// Withdraw 0.2 0G from your broker account to wallet\nimport { withdraw } from '0g-kit';\nawait withdraw(0.2); \n```\n\n## Advanced Configuration\n\n```javascript\nimport { initZeroG } from '0g-kit';\n\n// Advanced setup with custom options\ninitZeroG({\n  privateKey: '0x1234567890abcdef...',\n  rpcUrl: 'https://evmrpc-testnet.0g.ai',\n  autoDeposit: true,\n  defaultModel: 'deepseek-chat', \n  timeout: 30000,\n  retries: 3,\n  logLevel: 'info' \n});\n```\n\n## Chat Options \n\n### will be implemented once 0G activates the feature on each models ⚠️\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `model` | string | `auto` | AI model to use |\n| `provider` | string | `auto` | Specific AI provider address |\n| `temperature` | number | `0.7` | Response creativity (0.0-1.0) |\n| `maxTokens` | number | `1000` | Maximum response length |\n| `timeout` | number | `30000` | Request timeout |\n| `retries` | number | `3` | Retry attempts |\n\n---\n\n# �� 0G Storage Network\n\n## File Storage Operations\n\n```javascript\n// Upload a file (2 lines!)\nimport { uploadFile } from '0g-kit';\nconst result = await uploadFile('./my-file.txt');\nconsole.log('Root Hash:', result.rootHash);\n```\n\n```javascript\n// Download a file (2 lines!)\nimport { downloadFile } from '0g-kit';\nawait downloadFile(result.rootHash, './downloaded-file.txt');\n```\n\n```javascript\n// Upload with custom gas price\nimport { uploadFileWithGas } from '0g-kit';\nconst result = await uploadFileWithGas('./my-file.txt', '10000000'); // 10 gwei\nconsole.log('Root Hash:', result.rootHash);\n```\n\n```javascript\n// Upload with custom options\nimport { uploadFile } from '0g-kit';\nconst result = await uploadFile('./my-file.txt', {\n  timeout: 120000,  // 2 minutes\n  retries: 5\n});\n```\n\n```javascript\n// Get file information\nimport { getFileInfo } from '0g-kit';\nconst info = await getFileInfo(result.rootHash);\nconsole.log('File size:', info.fileSize);\n```\n\n## Key-Value Storage Operations\n\n```javascript\n// Upload key-value data (2 lines!)\nimport { uploadKeyValueFile } from '0g-kit';\nconst result = await uploadKeyValueFile('my-stream', 'user-settings', JSON.stringify({theme: 'dark'}));\nconsole.log('Transaction Hash:', result.txHash);\n```\n\n```javascript\n// Download key-value data (2 lines!)\nimport { downloadKeyValueFile } from '0g-kit';\nconst value = await downloadKeyValueFile('my-stream', 'user-settings');\nconst settings = JSON.parse(value);\nconsole.log('User theme:', settings.theme);\n```\n\n```javascript\n// KV operations with custom options\nimport { uploadKeyValueFile } from '0g-kit';\nconst result = await uploadKeyValueFile('my-stream', 'config', 'value', {\n  timeout: 60000,  // 1 minute\n  retries: 3\n});\n```\n\n## Stream Operations\n\n```javascript\n// Upload a stream (2 lines!)\nimport { uploadStream } from '0g-kit';\nconst result = await uploadStream(myReadableStream, { filename: 'data.txt' });\nconsole.log('Transaction Hash:', result.txHash);\n```\n\n```javascript\n// Download as stream (2 lines!)\nimport { downloadStream } from '0g-kit';\nconst stream = await downloadStream(result.rootHash);\nstream.pipe(fs.createWriteStream('output.txt'));\n```\n\n```javascript\n// Stream operations with custom options\nimport { uploadStream } from '0g-kit';\nconst result = await uploadStream(myReadableStream, {\n  filename: 'large-file.bin',\n  timeout: 300000,  // 5 minutes\n  retries: 5\n});\n```\n\n## Storage Options\n\n### File Storage Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `timeout` | number | `300000` | Upload/download timeout in milliseconds |\n| `retries` | number | `3` | Number of retry attempts |\n| `gasPrice` | string | - | Custom gas price for upload transactions (in wei as string) |\n\n### Key-Value Storage Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `timeout` | number | `300000` | KV operation timeout in milliseconds |\n| `retries` | number | `3` | Number of retry attempts |\n| `gasPrice` | string | - | Custom gas price for KV transactions (in wei as string) |\n\n### Stream Storage Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `timeout` | number | `300000` | Stream operation timeout in milliseconds |\n| `retries` | number | `3` | Number of retry attempts |\n| `gasPrice` | string | - | Custom gas price for stream transactions (in wei as string) |\n| `filename` | string | `stream-data` | Optional filename for stream uploads |\n\n### Gas Price Examples\n\n```javascript\n// Default gas price (automatic)\nconst result = await uploadFile('./file.txt');\n\n// Custom gas price via options\nconst result = await uploadFile('./file.txt', {\n  gasPrice: '10000000' // 10 gwei\n});\n\n// Direct gas price control\nconst result = await uploadFileWithGas('./file.txt', '10000000'); // 10 gwei\n```\n\n---\n\n## ⚙️ Configuration Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `privateKey` | string | **required** | Your EVM private key (0x-prefixed) |\n| `rpcUrl` | string | `https://evmrpc-testnet.0g.ai` | 0G network RPC endpoint |\n| `indexerRpcUrl` | string | `https://indexer-storage-testnet-turbo.0g.ai` | 0G storage indexer RPC endpoint |\n| `autoDeposit` | boolean | `true` | Automatically deposit 0.1 OG on initialization |\n| `defaultModel` | string | `deepseek-chat` | Default AI model to use |\n| `timeout` | number | `30000` | Request timeout in milliseconds |\n| `retries` | number | `3` | Number of retry attempts |\n| `logLevel` | string | `info` | Logging level (`debug`, `info`, `warn`, `error`, `silent`) |\n\n## 🔧 Error Handling\n\nThe SDK provides clear error types:\n\n```javascript\nimport { ConfigurationError, NetworkError, InsufficientFundsError } from '0g-kit';\n\ntry {\n  const response = await chat('Hello');\n} catch (error) {\n  if (error instanceof ConfigurationError) {\n    console.log('Configuration issue:', error.message);\n  } else if (error instanceof InsufficientFundsError) {\n    console.log('Need more funds:', error.message);\n  } else if (error instanceof NetworkError) {\n    console.log('Network issue:', error.message);\n  }\n}\n```\n\n## 🛠️ Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Build the project\nnpm run build\n\n# Run tests\nnpm test\n\n# Development mode\nnpm run dev\n```\n\n## 🚀 Future Releases\n\n- 🔄 **0G Data Availability** - Data availability layer support in development\n- 🔄 **Advanced Storage Features** - Batch uploads, streaming, and more storage capabilities\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","readmeFilename":"README.md"}