Current collected state Current
Observed since 20 Oct, 23:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0xflair/react-coingecko
React hooks to get prices of cryptocurrency coins and tokens from CoinGecko.
react-coingeckoReact hooks to get prices of cryptocurrency coins and tokens from CoinGecko.
Install the package:
npm install @0xflair/react-coingecko
Install peer dependencies:
npm install axios
# if visual components needed:
npm install tailwindcss @headlessui/react @heroicons/react @tailwindcss/aspect-ratio
Configure tailwind.config.js (Tailwind v3) to scan SDK for classes (if visual components needed):
module.exports = {
purge: [
"./public/**/*.html",
"./src/**/*.{js,jsx,ts,tsx,vue}",
// This line tells Tailwind to look into SDK files
"./node_modules/@0xflair/**/*.{js,jsx,ts,tsx,vue}",
],
content: ["./src/**/*.{js,jsx,ts,tsx}"],
plugins: [
// These plugins are used in this package
require("@tailwindcss/forms"),
require("@tailwindcss/aspect-ratio"),
],
};
Configure the React provider:
const cryptoPricesConfig = {
coinGecko: {
apiKey: "xxxx",
symbols: ["ethereum", "matic-network"],
},
};
const App = () => {
return (
<div className="app">
<CoinGeckoProvider config={cryptoPricesConfig}>
<HookExample />
</CoinGeckoProvider>
</div>
);
};
import { CryptoPrice, CryptoUnits } from "@0xflair/react-coingecko";
function App() {
return (
<>
<CryptoPrice value='0.06' unit={CryptoUnits.ETHER} />
</>
);
import { useCryptoPrice } from "@0xflair/react-coingecko";
function App() {
const [{data, error, loading}, fetchPrice] = useCryptoPrice({
symbol: 'ethereum'
});
return (
<ul>
<li>Price of Ether: {data.usd} USD</li>
<li>Loading: {loading ? 'Yes...' : 'Idle'}</li>
<li>Error: {error}</li>
</ul>
);
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
@0xflair/commonEnvironment{
"local_name": "@0xflair/common",
"alias": false,
"peer_metadata": null
} | ^0.113.3 | runtime |
@0xflair/react-commonEnvironment{
"local_name": "@0xflair/react-common",
"alias": false,
"peer_metadata": null
} | ^0.113.3 | runtime |
axiosEnvironment{
"local_name": "axios",
"alias": false,
"peer_metadata": null
} | ^0.26.1 | runtime |
ethersEnvironment{
"local_name": "ethers",
"alias": false,
"peer_metadata": null
} | ^5.6.5 | runtime |
wagmiEnvironment{
"local_name": "wagmi",
"alias": false,
"peer_metadata": null
} | ^0.3.5 | runtime |
@types/reactEnvironment{
"local_name": "@types/react",
"alias": false,
"peer_metadata": null
} | ^18.0.10 | development |
@types/react-domEnvironment{
"local_name": "@types/react-dom",
"alias": false,
"peer_metadata": null
} | ^18.0.5 | development |
@0xflair/commonEnvironment{
"local_name": "@0xflair/common",
"alias": false,
"peer_metadata": null
} | 0.* | peer |
@0xflair/react-commonEnvironment{
"local_name": "@0xflair/react-common",
"alias": false,
"peer_metadata": null
} | 0.* | peer |
axiosEnvironment{
"local_name": "axios",
"alias": false,
"peer_metadata": null
} | ^0.26.1 | peer |
ethersEnvironment{
"local_name": "ethers",
"alias": false,
"peer_metadata": null
} | ^5.6.5 | peer |
reactEnvironment{
"local_name": "react",
"alias": false,
"peer_metadata": null
} | ^16 || ^17 || ^18 | peer |
react-domEnvironment{
"local_name": "react-dom",
"alias": false,
"peer_metadata": null
} | ^16 || ^17 || ^18 | peer |
wagmiEnvironment{
"local_name": "wagmi",
"alias": false,
"peer_metadata": null
} | ^0.3.5 | peer |
Source distribution
{
"integrity": "sha512-hXCi3r5/HfugnGUweO4hbXhGW4DH6YBYmqkcGg+YOx/Wf6uDYyl3DYtdG45IDlNmFmBzdrY076zOCIDRFs1HKg==",
"shasum": "109e024f3680bd1f9d135606586fcf07bee695c9",
"tarball": "https://registry.npmjs.org/@0xflair/react-coingecko/-/react-coingecko-0.113.3.tgz",
"fileCount": 8,
"unpackedSize": 158000,
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIFXdR6tNyBd38NlbFTMbGGyj94hkf4qbcG7hZuhYJEqcAiEA68aw0Qer3WxdqGwf44w3u01ai4CKDHu9chLEBwepWQA="
}
],
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjFMEXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq9Dw//ZeHY5bzCVVDgjXWOhefZGj+t/epgBLJXnL+CFK43w+tWhfla\r\nnZKQ4puHX4A1DBudOF/kLyTceiYcYA+IMf91tLfpm+IkbDraHYjWjyOdddc4\r\nouPoBp/Jrf4zKuIYaqdQXdMiZqely1SSUDRXbeWi+/SSklHh0Xq7AYqNARzJ\r\nZNQbP1RUkuTsc0m+uP+V+kwGdGet0i2sEhwUB28ybcx8+6FCIKCVbb54Yf75\r\nk/e2vfKNMd2hOKPegUdgDFvb3s/CzzYoIx2oGnfMS2aIOCrguf4yDv3q1RIw\r\nHY0gsmgvIj2xZnf6Xr3KJWYp6pH40sWqT9IDNWycOL7PhlwfqOVnCyg/YElo\r\nFXO0315LPMTNcuJ+uGtFfVTBqy+3d+4sTxHkNxsWWxcKlmKaj0k9na/RsaOc\r\nqLKsS4qA0yJwQgwZvu2h81T+jg/bFJllR+8eSozSd8XdZaMZOAo7yPW3C8IM\r\nhKntmL5kmU9hEo2RAPaJdIukOHKthy6ubk+KGOVIqAxTmT7fwQOee3C3kozP\r\n3v1eesF/sAOv22w0wuPP2fu6HiF+yI9QjT8Rlr3DCBH5WEu3NqI24a+sBUkq\r\nb796+XzRRvHawVXna+/g02+5L3dPz/AymeTMSv5W66u6K0JiQ0OpEXkJinD3\r\n4rSUgJvg0CQAYvdDW9X44z09azur36CZQs4=\r\n=cLok\r\n-----END PGP SIGNATURE-----\r\n"
}Observed since 20 Oct, 23:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:d7b07e8df5464cd1bfb36e4fe9da62babedb455cac386caad55c8e78e811f8c7