Stellarswap is a global exchange board for all Stellar token and cryptocurrencies (coins). Easy sign up, easy trading. developed by Graichi Younes.
*This library requires the cURL extensions for PHP. To enable this extension, see:
Clone the project or download it and copy it to your main direction (Example: /var/www/html/).
git clone https://github.com/jonasess/Stellarswap
Set up the configuration of your email server (to enable users reset password) in this file stellarSwap-confresetpassword.php
- Check the link
https://github.com/jonasess/Stellarswap/blob/master/stellarSwap-confresetpassword.php#L41
Sent up the data base tables Stellarswapdbtables
Set up your database connection configuration in this directory include/dbconnection.php
Run ..
-
Add the logo of the asset in the direction
logo/...
-
Add the information of your asset in the file stellarSwap-assetTokens.js
- Example:
[
'Asset-website',
'Asset-logo-direction example: logo/myaaset.png',
'Asset code',
'Asset issuer'
],
- Do the same step in the file stellarSwap-assetTokens.php , add your asset information in the $asset_tokes array .
- Example
array("domain"=>"your-domain-name","logo"=>"Asset-logo-direction","code"=>"Asset code","issuer"=>"Asset issuer id"),
And congratulations your asset has been added to the board for the trading.
To add new coin like (BTC,LTC ... etc) follow the following steps:
- Go to logo folder and add your coin logo.png there.
- Add new row in your database (stellarswapbdtables) stellardbswap.sql
For example you want to add litcoin . add new row named
stlitcoinkey
in the table stellarswapusers. - Go to this file stellarSwap-checking.php
and add the information of your coin, as an example:
array("logo"=>"logo/litcoin.png","code"=>"LTC","swcoinkey"=>$row["stlitcoinkey"])
- Go to this file include/rpcdaemonpassword.php add these lines of your new coin(it's really required to connect your website to your coin daemon via rpc).as example for litcoin
else{
if($coincode=="LTC"){
$coinrpcuser='rpcuser';
$coinrpcpassword='rpcpassword';
$coinrpcip='ip address where litcoin daemon is running';
$coinrpcport='rpcport';
}
}
Also add in the same file here include/rpcdaemonpassword.php these lines which is related to the passphrase (it's really required for the permissions later on in transactions). As an example for litcoin:
else{
if($coincode=="LTC"){
$passphrase='your passphrase';
}
}
- Go to this file stellarSwap-signin-account.php and add these lines to allow the new users to get new address for your new added coin. let's take LTC as an example here:
$litcoinconnectionrpc=initconnectionrpc("GCH");
$litcoinkey=$litcoinconnectionrpc->getnewaddress("litcoin".$_POST["email"]);
then add it to data base
if ($stmt = $conn->prepare("INSERT INTO stellarswapusers (swemail,swpassword,swsecretkey,
swpublickey,swbtccoinkey,swgalaxycashcoinkey,stlitcoinkey) VALUES (?, ?, ?, ?, ?, ?,?)"))
$stmt->bind_param("sssssss", $email, $password, $sek, $pbk, $btcoinkey, $galaxycashkey,$litcoinkey);
- Finally go to this file updateusertable/updateoncoinadd.php And add your new coin configuration (litcoin as an example) and run it. It's really important to do this last step because it will add automatically new litcoin address for example to your users who are already registered in your website befor adding the new coin .
Stellarswap uses the rpc to connect to daemon to support any coin (BTC, GCH ...etc). Giving the ability to create wallet, send and receive payments, exchange vs coins or tokens (stellar tokens) ... etc .
- Support more coins and tokens.
- Add more security to the board.
- History of Stellar trades is under maintenance.
- There's no History exchanges of coins yet, i will add it soon.
- One file is missing
(stellarSwap-tradecoinvstoken.php)
it's under maintenance for security purpose. contains some mistakes. 4.passwords are saved without encrypt . Need to be encrypted.
If you like the project and you want to support me . You can donate:
- Stellar wallet:
GDI4HFEIZIPUGMXL7MM5BXRAJKC76XU2EDSS6GML2PL7MBTG6GICUYS3
- BTC wallet:
1PD1UBxTajiHEa4oDZex6QN6UT4aRxCDsM
- ETH wallet:
0x083c01b98810e17b0b6cce27cb1cb37a6a40e4eb
- LTC wallet:
LQ3fQoLJkW7hwuPdWtcPa5YYtAvmsp7UCs
You can contact me on GitHub or on my email address jonasess@gmail.com / younes.graichi.93@gmail.com .