Table of Contents
If you want to go directly to the installation and usage click here
About The Project
Many Open-Source dApps on top of Ergo have already developed their dApp connector. Every dApp has done it similarly but with some minor differences. New developers coming into Ergo will be able to avoid spending days developing and testing something that has already been done, giving them more time to focus on their specific project. This component contains the Ergo dApp Connector and can help new developers by adding the dApp Connector in a few clicks.
No dApp has implemented clearing wallet functionality to this date(30/05/2022), we believe this is a huge step in the Ergo ecosystem that improves user experience.
This idea came from an Ergo Community member suggesting creating more documentation regarding Ergo dApp Connection. He was having trouble with the dApp connector, and looking at the open-Source code was not enough. His suggestion made the Night Owl team believe that creating an Ergo dApp Connector during the ErgoHack would potentially be the most helpful tool for future developers coming to build on Ergo. We're hoping our open-source code helps other projects too!
Open-source is the way!
1. What is this package/library?
Ergo dApp Connector library for React came out of the necessity of various users while developing websites for their dApps. The package contains a component that is an Ergo dApp Connector, which means that by downloading it and calling it in your code, you will have handled the whole dApp Connection! Examples of how to do this will be demonstrated.
2. Who does it benefit?
It benefits new developers coming to build on Ergo who want to avoid dealing with the dApp Connection. Even if the developer didn’t want to use the package itself, he could access this package's public and open-source repository, understand how it is done line by line, and learn the process.
Built With
As mentioned it is a React Package, therefore React will be the JS library used for this package. Created using React version ^18.1.0.
Getting Started
Here we will explain how to properly use the package.
Prerequisites
Although these are very obvious requisites, and surely installed by any web developer, they are:
- Node.js
https://nodejs.org/
- npm (Although this is likely installed by installing Node)
npm install [email protected] -g
- Nautilus^0.4.0
https://chrome.google.com/webstore/detail/nautilus-wallet/gjlmehlldlphhljhpnlddaodbjjcchai
- SAFEW^0.6.3 (Still in development check safewImplementation branch.)
https://chrome.google.com/webstore/detail/simple-and-fast-ergo-wall/fmpbldieijjehhalgjblbpgjmijencll/
Installation
How to install, import and use the Ergo dApp Connector in your code!
- Install the package.
npm install ergo-dapp-connector
Usage
- Import the dApp Connector in the .js file where you will be using it
import {ErgoDappConnector} from "ergo-dapp-connector";
- Call the component ErgoDappConnector that you just imported anywhere in your code where you want to display it.
">
<ErgoDappConnector color="orange"/>