Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@0xflair/react-coingecko
Advanced tools
Readme
react-coingecko
React 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>
);
FAQs
React hooks to get prices of cryptocurrency coins and tokens from CoinGecko.
The npm package @0xflair/react-coingecko receives a total of 2 weekly downloads. As such, @0xflair/react-coingecko popularity was classified as not popular.
We found that @0xflair/react-coingecko demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.