{"_id":"@anu-dev/jupiter-solana-tokens-list","_rev":"4-761f25ff98b2e26476e2cda13e3e9c5a","name":"@anu-dev/jupiter-solana-tokens-list","description":"React Provider for Solana Token List provided by Jup.ag","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"@anu-dev/jupiter-solana-tokens-list","version":"1.0.0","keywords":["solana","jupiter","jup","tokens","react","react","native"],"author":{"name":"anu.dev"},"license":"MIT","_id":"@anu-dev/jupiter-solana-tokens-list@1.0.0","maintainers":[{"name":"vimalramaka","email":"vimmy2492@gmail.com"}],"dist":{"shasum":"c77a80db9c312b23e48988ab8524f5986a32f5a9","tarball":"https://registry.npmjs.org/@anu-dev/jupiter-solana-tokens-list/-/jupiter-solana-tokens-list-1.0.0.tgz","fileCount":4,"integrity":"sha512-3txLlqxaHVNKlB2cfl8aP1ZfciQwjUv/VHZltTRVd1i0IuYlv0m1h8X6ATer2jvsF1gchGw9rprDKO7MY/Q3oA==","signatures":[{"sig":"MEYCIQDSR0lcF0ro5YOsE50kZNlr+8jupViQDiH8eSKpKDRshwIhAPuyVjrAOuRgYM/wbDHcVncDYVGY1JAOtLS+igFAS4sD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10353},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"vimalramaka","email":"vimmy2492@gmail.com"},"repository":{"git":"https://github.com/anu-component-library/jupiter-solana-tokens-list.git"},"_npmVersion":"8.19.2","description":"React Provider for Solana Token List provided by Jup.ag","directories":{},"_nodeVersion":"16.18.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.5"},"_npmOperationalInternal":{"tmp":"tmp/jupiter-solana-tokens-list_1.0.0_1714266626127_0.1254350435602387","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@anu-dev/jupiter-solana-tokens-list","version":"1.0.1","keywords":["solana","jupiter","jup","tokens","react","react","native"],"author":{"name":"anu.dev"},"license":"MIT","_id":"@anu-dev/jupiter-solana-tokens-list@1.0.1","maintainers":[{"name":"vimalramaka","email":"vimmy2492@gmail.com"}],"dist":{"shasum":"d97df03fd559781a38f37c5d667b7105f93ba060","tarball":"https://registry.npmjs.org/@anu-dev/jupiter-solana-tokens-list/-/jupiter-solana-tokens-list-1.0.1.tgz","fileCount":4,"integrity":"sha512-a5Zj/x7S+xqFK6qtmJd6RfWDaunEkqQKW4ycaHXNnmog4UiIbwqAhsojcrPOKipo3UOfQ3YjQoz9OX7i3WIORw==","signatures":[{"sig":"MEUCIDXwMktLLAAYyGwxRMO8CyncZv5QZ3VgH7qu+94TgVghAiEAx1DT1c0vFW/PEYoaZoodHxfAiEwMDDOj4X20u8imxX4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10438},"main":"index.js","gitHead":"14d0c141b80c2865dad4e0391615707642ad5efb","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"vimalramaka","email":"vimmy2492@gmail.com"},"repository":{"git":"https://github.com/anu-component-library/jupiter-solana-tokens-list.git"},"_npmVersion":"8.19.2","description":"React Provider for Solana Token List provided by Jup.ag","directories":{},"_nodeVersion":"16.18.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.5"},"_npmOperationalInternal":{"tmp":"tmp/jupiter-solana-tokens-list_1.0.1_1714268242954_0.9440938431171644","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@anu-dev/jupiter-solana-tokens-list","version":"1.0.2","keywords":["solana","jupiter","jup","tokens","react","react","native"],"author":{"name":"anu.dev"},"license":"MIT","_id":"@anu-dev/jupiter-solana-tokens-list@1.0.2","maintainers":[{"name":"vimalramaka","email":"vimmy2492@gmail.com"}],"dist":{"shasum":"1374393f51ac3b6f0eba017f6871fb5ddaaa5a07","tarball":"https://registry.npmjs.org/@anu-dev/jupiter-solana-tokens-list/-/jupiter-solana-tokens-list-1.0.2.tgz","fileCount":4,"integrity":"sha512-IQX135KbzIfSQ5MNxHdoH0OGvPhOR0uIjZ3cgRhj2lM4loFerqgzLgK9diCCB0a/YPFJAY6JQ3sSREUfxA5vsg==","signatures":[{"sig":"MEQCIHSWhR6q3eHWvB7jyJgHhJOl33AuPgsC7MIxGRCYJTBpAiAC4VsMejkTWR/Yji16+VkCMNb08SVK2Sq8cJ/3DRjqIw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10436},"main":"index.js","gitHead":"14d0c141b80c2865dad4e0391615707642ad5efb","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"vimalramaka","email":"vimmy2492@gmail.com"},"repository":{"git":"https://github.com/anu-component-library/jupiter-solana-tokens-list.git"},"_npmVersion":"8.19.2","description":"React Provider for Solana Token List provided by Jup.ag","directories":{},"_nodeVersion":"16.18.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.5"},"_npmOperationalInternal":{"tmp":"tmp/jupiter-solana-tokens-list_1.0.2_1714268474035_0.2158611493243181","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@anu-dev/jupiter-solana-tokens-list","version":"1.0.3","keywords":["solana","jupiter","jup","tokens","react","react","native"],"author":{"name":"anu.dev"},"license":"MIT","_id":"@anu-dev/jupiter-solana-tokens-list@1.0.3","maintainers":[{"name":"vimalramaka","email":"vimmy2492@gmail.com"}],"dist":{"shasum":"800d5221e27bceea475307e2eda5cb9ebe71dab2","tarball":"https://registry.npmjs.org/@anu-dev/jupiter-solana-tokens-list/-/jupiter-solana-tokens-list-1.0.3.tgz","fileCount":4,"integrity":"sha512-ceEdzPomFftNjiOx8q0fKC+q2VJNK2ZVvc+fzPi0WVqE3dkDpVcNmDBfN4MLWmVdDnNMedfOA32Se+S6gCm3Bg==","signatures":[{"sig":"MEQCIFUl/a0eQeBdNmXKM2A+UH9WKEDhqglsBQbUwNnloo4UAiBMnmMzJtN3lC+xzH2ADnRNX0RPQXYIYBLxNAd0gftq1w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13547},"main":"index.js","gitHead":"569c109009471acffacf4cffea02786d125d7ea4","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"vimalramaka","email":"vimmy2492@gmail.com"},"repository":{"git":"https://github.com/anu-component-library/jupiter-solana-tokens-list.git"},"_npmVersion":"8.19.2","description":"React Provider for Solana Token List provided by Jup.ag","directories":{},"_nodeVersion":"16.18.0","_hasShrinkwrap":false,"devDependencies":{"react":"^18.3.1","typescript":"^5.4.5"},"_npmOperationalInternal":{"tmp":"tmp/jupiter-solana-tokens-list_1.0.3_1717985230000_0.36289298716113305","host":"s3://npm-registry-packages"}},"1.0.5":{"name":"@anu-dev/jupiter-solana-tokens-list","version":"1.0.5","description":"React Provider for Solana Token List provided by Jup.ag","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["solana","jupiter","jup","tokens","react","react","native"],"repository":{"git":"https://github.com/anu-component-library/jupiter-solana-tokens-list.git"},"author":{"name":"anu.dev"},"license":"MIT","devDependencies":{"@types/react":"^18.3.3","react":"^18.3.1","typescript":"^5.4.5"},"gitHead":"0360ae62cd87e5319e1da56e6eaf028833de2a58","_id":"@anu-dev/jupiter-solana-tokens-list@1.0.5","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-RrnX4KQZrxbBhboFEbfIAm9rWY/5aYjhvTcWmDrgOf4ZamHf7IpWuqQrB2zRh+oA8OzpwCkXaQVp5WIa2wRMtg==","shasum":"e8b6a2ab0c3ce3db56a93c5b32689032de507b85","tarball":"https://registry.npmjs.org/@anu-dev/jupiter-solana-tokens-list/-/jupiter-solana-tokens-list-1.0.5.tgz","fileCount":5,"unpackedSize":25502,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOGgwuvLulzG8U+9G4oKd8XYW2F2mRpmmDMO836lsySQIgFtch6xFZ0Ash9JVpH6PpB/o53KedsCVbpXOSH8W96rs="}]},"_npmUser":{"name":"vimalramaka","email":"vimmy2492@gmail.com"},"directories":{},"maintainers":[{"name":"vimalramaka","email":"vimmy2492@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jupiter-solana-tokens-list_1.0.5_1717987537355_0.6240323602555655"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-28T01:10:26.022Z","modified":"2024-06-10T02:45:37.754Z","1.0.0":"2024-04-28T01:10:26.303Z","1.0.1":"2024-04-28T01:37:23.116Z","1.0.2":"2024-04-28T01:41:14.177Z","1.0.3":"2024-06-10T02:07:10.159Z","1.0.5":"2024-06-10T02:45:37.527Z"},"maintainers":[{"name":"vimalramaka","email":"vimmy2492@gmail.com"}],"author":{"name":"anu.dev"},"repository":{"git":"https://github.com/anu-component-library/jupiter-solana-tokens-list.git"},"keywords":["solana","jupiter","jup","tokens","react","react","native"],"license":"MIT","readme":"# Solana Tokens List (Jupiter)\n\nThe `SolanaTokensProvider` is a React context provider designed to facilitate the fetching and distribution of Solana token data across React applications. It provides convenient access to two key datasets: strict tokens and all tokens, optionally including banned tokens. Additionally, it supports automatic loading of token data when the provider mounts, based on configurable options.\n\nPowered by Jupiter (jup.ag)'s token list.\n\n## Features\n\n- Fetch and distribute Solana token data using React context.\n- Automatic loading of token data on provider mount (`autoLoad`).\n- State management to maintain and expose fetched token data along with loading status.\n- Error handling during data fetching operations with console output for debugging.\n- Lightweight implementation using native Fetch API.\n\n## Installation\n\nInstall the package using npm:\n\n```bash\nnpm install @anu-dev/jupiter-solana-tokens-list\n```\n\nOr using yarn:\n```bash\nyarn add @anu-dev/jupiter-solana-tokens-list\n```\n\n## Usage\nFirst, wrap your application's root component with the `SolanaTokensProvider` to ensure that all components in your app can access the token data.\n\nConfigure the optional `autoLoad` prop to automatically load specific token data on mount.\n\n```tsx\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { SolanaTokensProvider } from '@anu-dev/jupiter-solana-tokens-list';\nimport App from './App'; // Your App component\n\nReactDOM.render(\n  <React.StrictMode>\n    <SolanaTokensProvider autoLoad=\"all\">\n      <App />\n    </SolanaTokensProvider>\n  </React.StrictMode>,\n  document.getElementById('root')\n);\n```\n\nIf the `autoLoad` prop is not used, use the provided hook `useSolanaTokens` within any component to fetch token data:\n\n```tsx\nimport React, { useEffect } from 'react';\nimport { useSolanaTokens } from '@anu-dev/jupiter-solana-tokens-list';\n\nconst TokenList = () => {\n  const { getAllTokens, getStrictTokens } = useSolanaTokens();\n\n  useEffect(() => {\n    getAllTokens().then(tokens => console.log(tokens)).catch(error => console.error(\"Failed to fetch all tokens:\", error));\n    getStrictTokens().then(tokens => console.log(tokens)).catch(error =>  console.error(\"Failed to fetch strict tokens:\", error));\n  }, []);\n\n  return <div>Check console for token details!</div>;\n};\n\nexport default TokenList;\n```\n\nUse the provided hook `useSolanaTokens` within any component to access token data:\n\n```tsx\nimport React from 'react';\nimport { useSolanaTokens } from '@anu-dev/jupiter-solana-tokens-list';\n\nconst TokenList = () => {\n  const { solTokens, solTokensLoading } = useSolanaTokens();\n\n  if (solTokensLoading) {\n    return <div>Loading tokens...</div>;\n  }\n\n  return (\n          <div>\n            {solTokens.map(token => (\n                    <div key={token.address}>\n                      {token.name} ({token.symbol})\n                    </div>\n            ))}\n          </div>\n  );\n};\n\nexport default TokenList;\n```\n## Configuration\n\n### autoLoad Prop\n\nThe `autoLoad` prop in the `SolanaTokensProvider` controls the automatic loading of token data when the provider mounts, facilitating immediate data availability without manual invocation. Here are the options available for the `autoLoad` prop:\n\n- **`strict`**: Automatically fetches and loads a list of strict Solana tokens. These tokens meet stringent criteria and are typically used where strict compliance with specific attributes is necessary.\n\n- **`all`**: Automatically fetches and loads all Solana tokens, except those marked as banned. Ideal for applications needing comprehensive visibility of available tokens without banned entries.\n\n- **`all+banned`**: Automatically fetches and loads all Solana tokens, including those marked as banned. Useful for applications that require a complete dataset, including tokens that might be flagged for various reasons.\n\nThese options can be configured based on the specific requirements of your application, ensuring that the relevant token data is loaded and ready upon the initial render of your app's UI.\n\n\n## API\n\nThe provider offers the following functions:\n\n- `getStrictTokens()`: Fetches and returns a list of strict Solana tokens.\n- `getAllTokens(includeBanned?: boolean)`: Fetches and returns a list of all Solana tokens. If `includeBanned` is true, the banned tokens will also be included in the response.\n- `solTokens`: An array of Solana tokens currently loaded into the context's state.\n- `solTokensLoading`: A boolean that indicates whether the tokens are currently being fetched.\n\n### Types\n\n- `SolanaToken`: Describes the structure of a Solana token object.\n    - `address`: string\n    - `chainId`: number\n    - `decimals`: number\n    - `name`: string\n    - `symbol`: string\n    - `logoURI`: string\n    - `tags?`: string[]\n    - `extensions?`: Record<string, string>\n\n## Contributing\n\nContributions to the `@anu-dev/jupiter-solana-tokens-list` are welcome! Please follow these steps to contribute:\n\n1. Fork the repository.\n2. Create a new branch for each feature or improvement.\n3. Submit a pull request with comprehensive description of changes.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","readmeFilename":"README.md"}