Skip to content

RafaelCaso/currency-conversion-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Currency Conversion Extension for ScaffoldETH2

  1. Visit ExchangeRate-API to get a free API key.

  2. In terminal, use the below snippet to bootstrap a new ScaffoldEth project with the currency-conversion-extension

npx create-eth@latest -e rafaelcaso/currency-conversion-extension

You will be prompted for a project name and a choice of Hardhat or Foundry

  1. After you've initialized your project cd your-project-name and install packages using yarn install

  2. Open the project in your editor of choice and navigate to

|-- packages
|   |-- nextjs

and locate the file called .env.example

rename this to simply .env

Add your API key to the .env file using the exact variable name NEXT_PUBLIC_CURRENCY_API_KEY

NEXT_PUBLIC_CURRENCY_API_KEY="replaceWithAPIKey"

Enter these commands in three different terminals

yarn chain
yarn deploy
yarn start

That's it! You can now open a web browser and go to localhost:3000 and see the project. In the header you will find the 'Currency' tab which has a simple input to easily convert between over 150 currencies


PLEASE NOTE - ExchangeRate-API provides a free key for once-daily conversion rates. To gain access to more frequent updates, you will need to purchase a pro membership.

The Currency Conversion Extension is designed to only call the API when there are updated rates available and cache results to prevent redundant API calls.

About

Convert from USD to any currency in Scaffold-eth2

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published