Based on some stringent needs for vendor wallets to easily connect with CowryProtocol, the withdraw and deposit modal as designed and obtainable in the Cowry Protocol application were extracted and converted into individual widgets.
A demo was created on Replt here
You can test on your lcoal machine by copying the code here test-widget-code
- clone the repo
git clone https://github.com/todak2000/cowryProtocolWidget.git
- Intall dependencies and associated libraries
cd cowryProtocolWidget
yarn install
- Run Test if you wish. Unit test for each component was written and component tested Here
yarn test
- Run the Start the Widget App locally
yarn start
For ease of accessibility, the widget was connected to a Content Delivery Network. Thus sharable CDN links is available below:
<!-- js file -->
https://cdn.jsdelivr.net/gh/todak2000/cowryProtocolWidget@main/src/js/assets/withdraw.js
https://cdn.jsdelivr.net/gh/todak2000/cowryProtocolWidget@main/src/js/assets/deposit.js
<!-- css file -->
https://cdn.jsdelivr.net/gh/todak2000/cowryProtocolWidget@main/src/js/assets/index-v1.0.3.css
Add them to your html file as shown below
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Widget Demo</title>
<!-- Deposit widget -->
<script type="module" crossorigin src="https://cdn.jsdelivr.net/gh/todak2000/cowryProtocolWidget@main/src/js/assets/deposit.js"></script>
<!-- Withdraw widget -->
<script type="module" crossorigin src="https://cdn.jsdelivr.net/gh/todak2000/cowryProtocolWidget@main/src/js/assets/withdraw.js"></script>
<!-- Widget CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/todak2000/cowryProtocolWidget@main/src/js/assets/index-v1.0.3.css">
</head>
<body>
<div id="root"></div>
</body>
</html>