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.120.11 | runtime |
@0xflair/react-commonEnvironment{
"local_name": "@0xflair/react-common",
"alias": false,
"peer_metadata": null
} | ^0.120.11 | runtime |
@wagmi/coreEnvironment{
"local_name": "@wagmi/core",
"alias": false,
"peer_metadata": null
} | ^0.2.5 | 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": {
"optional": true
}
} | * | peer |
@0xflair/react-commonEnvironment{
"local_name": "@0xflair/react-common",
"alias": false,
"peer_metadata": {
"optional": true
}
} | * | peer |
@wagmi/coreEnvironment{
"local_name": "@wagmi/core",
"alias": false,
"peer_metadata": null
} | * | peer |
axiosEnvironment{
"local_name": "axios",
"alias": false,
"peer_metadata": {
"optional": true
}
} | * | peer |
ethersEnvironment{
"local_name": "ethers",
"alias": false,
"peer_metadata": {
"optional": true
}
} | * | peer |
reactEnvironment{
"local_name": "react",
"alias": false,
"peer_metadata": {
"optional": true
}
} | ^16 || ^17 || ^18 | peer |
react-domEnvironment{
"local_name": "react-dom",
"alias": false,
"peer_metadata": {
"optional": true
}
} | ^16 || ^17 || ^18 | peer |
wagmiEnvironment{
"local_name": "wagmi",
"alias": false,
"peer_metadata": {
"optional": true
}
} | * | peer |
Source distribution
{
"integrity": "sha512-eHrCndV4MrcsrUjiOo87xMP4DKINDmn02mq9QZ7KefeIquG9yMrQQgRBWD+yhRcD7tPMi9oGjHWhYGRxQwo6tw==",
"shasum": "277fe19812d32a10fd54766a8107d2f17b161482",
"tarball": "https://registry.npmjs.org/@0xflair/react-coingecko/-/react-coingecko-0.120.11.tgz",
"fileCount": 8,
"unpackedSize": 146290,
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEYCIQDo/ViwtakRZbTGKgBhJIDOJ+dZrawj4U8Dmixg6M0WpwIhANVsomcq0TxnP/f5qbHZQwo8eQtwXDaYdvnm+reGLhxK"
}
],
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUZPBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTjw/+Lk5SmCW40wLvO8AeV5mGhJoZMaq/KAUK1BTVMT1kHztJjI8p\r\nAWiFwRhz0+qu3CZV0D6kE+mOvurrn3nWe6MGCkkou1XbdRDv25w1ChgQC38L\r\nPoPc836VxwycEY5X63b3rv91mgNtZMlDy1w5lNyJUmzv1odfOMKpkRRwa02s\r\nWhGxO/U/hzrP0p8BuzXujViipNzg2l22RtkvkEjpe9TenVc93JumGoX+oGmT\r\nHKOyOsjX2duyLf3//lfk8hwyJXzNsLUSRB/D9cREYtXpqR9SYiZ64zhuDxTS\r\nJ7xgP7WBheeQSebD4VUW23EUbyPVjlxcjh0Y5p9ZqddGzgO3k2quSS2lUu9i\r\nRssjnh2Of4066/MfkGIQi4BP3SjkbCygFZ7OnwoV2V7IVYutoK436StkSGhA\r\nP4ZGKreHaVYzyrpgHBvuk0wNQ2cEqgp6ijifSE5EpKNTw6RowMmFSaJSNPtF\r\n62Hfk6oUsmeE90NBoCRaQcCsgjNUBMtl+uut0+Nb4Zy1iNWjhBLBeGPiK4yv\r\nAIwF1HqiHdi3vbHNqErbD1BMm6RuiMrGL26J3oONT4G04etBxSHsZxEEYiuR\r\neemQSXeUM/L3Qs7lh5ZZ6fPWkBxvcyyS+uqK7SZp+0Trop3DVEIL8rDXa32v\r\n2Z1CiR3dbyrESHY2nZr/zTV8xzyIxxyItUM=\r\n=oLS1\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:353df126bbd25373728cf9069762579cc330870a8db1d5ccd3d166a4e567bf57