Logo Lanfrica
  • Home
  • Atlas
  • Insights
  • Docs
  • Sign in

© 2026 Lanfrica. All rights reserved. All copyrights of the resources shown on the Lanfrica website belong to the original copyright holders, unless explicitly stated otherwise.

KibokoDao-Africa/KibokoGetPriceHook

Record type:

software
Creator:
Kib
Host:
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