Automatically converts supported currencies on the website to RAI based on current exchange rates that are automatically fetched from the CoinGecko API.
Supported currencies: EUR, CNY, JPY, GBP, KRW, INR and DAI, USDC, sUSD, USDT, PAX, UST, BUSD, LUSD and FLOAT
Each currency conversion can be turned on or off. Exchange rates are automatically updated when user interacts with browser. A minimal update interval is 10 minutes.
Before extension reaches Chrome Web Store you can use it by downloading ZIP from https://github.com/johnmgrimm/multicurrency-rai-chrome-extension/releases/download/v1.0.2/multicurrency-rai-chrome-extension.zip and then using chrome://extensions/
, Developer mode
and Load unpacked
button point to the directory where you unpack extension files.
All supported currency cases are described with automated tests.
- 90.28% Statements 864/957
- 83.33% Branches 115/138
- 90.91% Functions 30/33
- 90.28% Lines 864/957
Can be verified by running yarn test --coverage
.
- Clone this repository
git clone https://github.com/johnmgrimm/multicurrency-rai-chrome-extension.git
- Install dependencies
yarn install
- Build extension
yarn build
- Load your extension on Chrome:
- Access
chrome://extensions/
- Check
Developer mode
- Click on
Load unpacked extension
- Select the
build
folder (the one inside this repository)
- Access
- Open extension options page to select currencies that you would like to convert to RAI
Here is a list of pages where you can see how this extension works.
https://info.uniswap.org/#/ https://www.coingecko.com/en/coins/bitcoin#markets https://demo.spreecommerce.org/t/categories/men/sweaters https://www.amazon.com/AmazonBasics-Kids-Fleece-Tail-Blanket/dp/B0843ZL15Z/ref=sr_1_2_sspa?dchild=1&keywords=amazonbasics&pd_rd_r=8e66b431-c7f8-4aa8-bd74-66cd753242c5&pd_rd_w=fVmbd&pd_rd_wg=gWcYu&pf_rd_p=9349ffb9-3aaa-476f-8532-6a4a5c3da3e7&pf_rd_r=ZJ1AWF2X0Z1KB71D1JX0&qid=1631994058&sr=8-2-spons&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEyQlI3NjlEVVBDV1c4JmVuY3J5cHRlZElkPUEwNDY1OTUyMllBMkNEQ0g0RlZJVSZlbmNyeXB0ZWRBZElkPUEwNTM4NDgxMTI3MjM1QTdMVkM0RiZ3aWRnZXROYW1lPXNwX2F0ZiZhY3Rpb249Y2xpY2tSZWRpcmVjdCZkb05vdExvZ0NsaWNrPXRydWU&th=1
- Clone this repository
git clone https://github.com/johnmgrimm/multicurrency-rai-chrome-extension.git
- Install dependencies
yarn install
- Build extension
yarn start
- Load your extension on Chrome:
- Access
chrome://extensions/
- Check
Developer mode
- Click on
Load unpacked extension
- Select the
build
folder (the one inside this repository)
- Access
- Build sources with
yarn build
- Prepare zip package with
yarn zip
- Upload zip package to Chrome Web Store
Run yarn test
or yarn test:watch
to run tests continuously.
Node v15+ is required for replaceAll()
to work as expected in tests (https://tekloon.medium.com/how-to-fix-replaceall-is-not-a-function-in-node-js-caf459e00abf).
Make sure that you are using the right version of the NodeJS.
You may use NVM to run multiple Node versions https://github.com/nvm-sh/nvm
- Yen and Yuan symbol looks the same, prefer one over the other
- Use jest-chrome to add more tests to Chrome API based functions
- Support partial matches together with onther text in one node e.g.
10<a>$ something $10 else</a>
- Handle degradated prices e.g.
<i>$.10</i>
or.10<i>$</i>
Extension code is based on the MIT licensed boilerplate repo https://github.com/lxieyang/chrome-extension-boilerplate-react
author: John Grimm