{"_id":"@akbaridria/use-covalent-api","_rev":"1-264f63092288a84256f3e2d1c9797f97","name":"@akbaridria/use-covalent-api","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@akbaridria/use-covalent-api","author":{"name":"Akbar Idria"},"main":"dist/index.cjs","module":"dist/index.mjs","typings":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"version":"1.0.0","peerDependencies":{"@covalenthq/client-sdk":">=0.9.2","react":">=16.8.0","react-dom":">=16.8.0"},"devDependencies":{"@covalenthq/client-sdk":"^0.9.2","@swc/core":"^1.4.2","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^13.0.0","@testing-library/user-event":"^13.2.1","@types/jest":"^27.0.1","@types/node":"^20.11.19","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","@typescript-eslint/eslint-plugin":"^7.0.2","@typescript-eslint/parser":"^7.0.2","eslint":"^8.56.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","eslint-plugin-react":"^7.33.2","prettier":"^3.2.5","react":"^18.2.0","react-dom":"^18.2.0","react-scripts":"5.0.1","tslib":"^2.6.2","tsup":"^8.0.2","typescript":"^5.3.3","web-vitals":"^2.1.0"},"scripts":{"build":"tsup"},"eslintConfig":{"extends":["react-app","react-app/jest"]},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2024 Akbar Idria\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","license":"MIT","_id":"@akbaridria/use-covalent-api@1.0.0","dist":{"shasum":"1a3e4f0477ed35777af4b07c2a1cb2bb32fffeaf","integrity":"sha512-c6x/ZocHuxYTn0uwOIK/qwP9jj0IOEOEyEIG58Ss6G9nfVK7LdMUGURCfsOaX/CfXbAvU4qmqkrmPJoyezFJRA==","tarball":"https://registry.npmjs.org/@akbaridria/use-covalent-api/-/use-covalent-api-1.0.0.tgz","fileCount":66,"unpackedSize":465568,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/2nDBOziR47m1bH5FjwgNu7+zsZ0YUG3GUY6EwjN++AIhAN80NqjqjZ1HJigkj0fizABEu8P45xPgrnTxzn9bCoRa"}]},"_npmUser":{"name":"akbaridria","email":"akbaridria15@gmail.com"},"directories":{},"maintainers":[{"name":"akbaridria","email":"akbaridria15@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-covalent-api_1.0.0_1708594184550_0.8071874820860838"},"_hasShrinkwrap":false},"1.0.1":{"name":"@akbaridria/use-covalent-api","author":{"name":"Akbar Idria"},"main":"dist/index.cjs","module":"dist/index.mjs","typings":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"version":"1.0.1","peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"dependencies":{"@covalenthq/client-sdk":"^0.9.2"},"devDependencies":{"@swc/core":"^1.4.2","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^13.0.0","@testing-library/user-event":"^13.2.1","@types/jest":"^27.0.1","@types/node":"^20.11.19","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","@typescript-eslint/eslint-plugin":"^7.0.2","@typescript-eslint/parser":"^7.0.2","eslint":"^8.56.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","eslint-plugin-react":"^7.33.2","prettier":"^3.2.5","react":"^18.2.0","react-dom":"^18.2.0","react-scripts":"5.0.1","tslib":"^2.6.2","tsup":"^8.0.2","typescript":"^5.3.3","web-vitals":"^2.1.0"},"scripts":{"build":"tsup"},"eslintConfig":{"extends":["react-app","react-app/jest"]},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2024 Akbar Idria\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","license":"MIT","_id":"@akbaridria/use-covalent-api@1.0.1","dist":{"shasum":"0548f6c1d7f713c962dac790c07a7a093d88ff19","integrity":"sha512-C8FCqxooJG3ob/W0snfdyn0jvm5C9o6jR7g1/JQZ3w3RpctYVdQ3pd6M/qDiR1NJBCnABtkJgGH02v3y1YpxEA==","tarball":"https://registry.npmjs.org/@akbaridria/use-covalent-api/-/use-covalent-api-1.0.1.tgz","fileCount":66,"unpackedSize":476270,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1Wf3Z3hLv+rZd4B6PequJ/IrX1Qt/e+XjMq8433RXkwIhAIXxOlcjI22Xiket1KOgrqMZvsKr+oBEXW+bQFtZyD6/"}]},"_npmUser":{"name":"akbaridria","email":"akbaridria15@gmail.com"},"directories":{},"maintainers":[{"name":"akbaridria","email":"akbaridria15@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-covalent-api_1.0.1_1708595375498_0.37080731165075487"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-22T09:29:44.462Z","1.0.0":"2024-02-22T09:29:44.692Z","modified":"2024-02-22T09:49:36.657Z","1.0.1":"2024-02-22T09:49:35.760Z"},"maintainers":[{"name":"akbaridria","email":"akbaridria15@gmail.com"}],"author":{"name":"Akbar Idria"},"license":"MIT","readme":"<p align=\"center\">\n  <img src=\"https://github.com/akbaridria/use-covalent-api/assets/26589426/5d999e71-6af6-4d5e-a453-177ac6743cf2\" />\n</p>\n\n<h1 align=\"center\" tabindex=\"-1\" dir=\"auto\">\n  USE-COVALENT-API\n</h1>\n\n<p align=\"center\">Simple React Hooks (🪝) For Fetching Covalent API</p>\n<p align=\"center\">\n  <img src=\"https://img.shields.io/badge/License-MIT-MIT\" />\n</p>\n\n<h3 tabindex=\"-1\" dir=\"auto\">\n  Introduction ⭐️\n</h3>\n<p dir=\"auto\">\n<strong>Unleash the power of the Covalent API in your React apps with ease!</strong> <br /> use-covalent-api provides a collection of custom React hooks that streamline fetching data from the Covalent API, eliminating the need for manual API calls and error handling. This library simplifies your development process, allowing you to focus on building amazing user experiences.\n</p>\n<h3 tabindex=\"-1\" dir=\"auto\">\n  Key Features 🔑\n</h3>\n<ul>\n  <li>Type Safety: Enjoy the benefits of TypeScript to ensure data consistency and prevent errors.</li>\n  <li>Easy Integration: use-covalent-api into your react/next app with a simple provider setup and use the hooks everywhere</li>\n  <li>Revalidation: Keep data fresh with built-in revalidation options at every hour.</li>\n  <li>Automatic Cancellation: Avoid unnecessary API calls and conserve resources by canceling requests when components unmount.</li>\n  <li>Leverages Covalent SDK: Built on top of the proven @covalenthq/client-sdk for reliable and efficient data fetching.</li>\n</ul>\n\n<h3 tabindex=\"-1\" dir=\"auto\">\n  Available Hooks 🪝\n</h3>\n<ul>\n  <li>Class A Endpoint ✅</li>\n  <li>Class B Endpoint ❌ (On Going)</li>\n  <li>Class C Endpoint ❌ (On Going)</li>\n  <li>Pricing Endpoint ✅</li>\n</ul>\n\n<h3 tabindex=\"-1\" dir=\"auto\">\n  Getting Started 🏁\n</h3>\n\n1. Install the library\n```bash\nnpm i -D @akbaridria/use-covalent-api\n// or\nyarn add -D @akbaridria/use-covalent-api\n```\n2. Set your Covalent API Key in `.env` file\n```javascript\n// react\nREACT_APP_COVALENT_KEY=\"your key\"\n// next\nNEXT_PUBLIC_COVALENT_KEY=\"your key\"\n```\n3. Setup Provider\n```javascript\n// react\n// in index.tsx / index.jsx\n\n....\nroot.render(\n  <React.StrictMode>\n    <CovalentProvider apiKey={process.env.REACT_APP_COVALENT_KEY as string}> // add provider here\n        <App />\n    </CovalentProvider>\n  </React.StrictMode>\n);\n\n// next js (app router)\n// create provider file ex: provider.tsx and wrapped it in layout\n\n\"use client\";\n\nimport { CovalentProvider } from \"@akbaridria/use-covalent-api\";\n\nexport default function Provider({ children }: { children: React.ReactNode }) {\n    return (\n        <CovalentProvider\n            apiKey={process.env.NEXT_PUBLIC_COVALENT_KEY as string}\n        >\n            {children}\n        </CovalentProvider>\n    );\n}\n\n```\n4. Import and use the hooks in your react component\n```javascript\nimport { useGetTokenBalanceForAddress } from \"@akbaridria/use-covalent-api\";\n\nexport function Component() {\n    const { data, errorDetail, loading, isError } = useGetTokenBalanceForAddress({ chainName: \"eth-mainnet\", walletAddress: \"vatalik.eth\" });\n    ....\n}\n```\n\n<h3 tabindex=\"-1\" dir=\"auto\">License 🪪</h2>\n<p dir=\"auto\">This project is <a href=\"https://github.com/akbaridria/use-covalent-api/blob/master/LICENSE\">MIT</a> licensed.</p>\n","readmeFilename":"README.md"}