Logo Lanfrica
  • Accueil
  • Atlas
  • Analyses
  • Documentation
  • Sign in

© 2026 Lanfrica. Tous droits réservés. Tous les droits d'auteur des ressources affichées sur le site Web Lanfrica appartiennent aux détenteurs de droits d'auteur d'origine, sauf indication contraire explicite.

KibokoDao-Africa/KibokoGetPriceHook

Type de record:

software
Créateur:
Kib
Hôte:
Package containing a bunch of functions that can be called to perform varios functions includeing: get price of crypto in local currencies,fetch price feeds from Starknet's pragma contract among others # KibokoGetPriceHook The kibokogetpricehook package provides utility functions to fetch real-time financial data, including pair prices, exchange rates, and currency-specific exchange rates. It's designed for seamless integration with financial applications. ## Installation ```bash # via npm npm i kibokogetpricehook # via yarn yarn add kibokogetpricehook ``` # 1. Getting Token Pair Price ## Description getPairPrice: Fetches the current price of a specified cryptocurrency pair. ## Usage ```ts import { getPairPrice } from 'kibokogetpricehook' const getTokenPairPrice = () => { getPairPrice('ETH/USD').then((res: any) => { console.log("Pair price: ", res) }).catch((err: any) => { console.error(err) }) } ``` # 2. Getting Exchange Rate ## Description getExchangeRate: Retrieves the exchange rate for a specified token against a base currency, dynamically responding to user input changes. ## Usage ```ts import { getExchangeRate } from "kibokogetpricehook"; // Updates the selected token and fetches its exchange rate. const handleTokenChangeForExchangeRate = (event: React.ChangeEvent ) => { const token = event.target.value; setSelectedToken(token); getExchangeRate(token, numberOfTokens); }; // Updates the number of tokens and fetches the updated exchange rate. const handleNumberOfTokensChangeForExchangeRate = async (event: React.ChangeEvent ) => { const tokens = event.target.value; setNumberOfTokens(tokens); try { const amountInKesReceived = await getExchangeRate(selectedToken, tokens); setAmountToReceive(String(amountInKesReceived)); console.log(amountInKesReceived); } catch (error) { console.error("Error fetching exchange rate", error); } }; ``` # 3. Getting Currency-Specific Exchange Rate ## Description getCurrencyExchangeRate: Obtains the exchange rate for a specified token against a set of currencies, using additional data for calculations. ## Usage ```ts import { getCurrencyExchangeRate } from "kibokogetpricehook"; // Updates the selected token and fetc …

Visit

github.com