mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 09:27:25 +00:00
Some constants for the btc addr, email and site url..
+ missing .gitignore / folder git keepers
This commit is contained in:
parent
4d8a873075
commit
d8fe695a46
50 changed files with 804 additions and 810 deletions
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
*.o
|
||||||
|
*.a
|
||||||
|
stratum/stratum
|
||||||
|
stratum/blocknotify
|
||||||
|
*.log
|
||||||
|
web/yaamp/runtime/*
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#yaamp
|
#yiimp - yaamp fork
|
||||||
|
|
||||||
Required:
|
Required:
|
||||||
|
|
||||||
linux, mysql, php, web engine, memcached
|
linux, mysql, php, memcached
|
||||||
|
|
||||||
Config for nginx:
|
Config for nginx:
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ Config for nginx:
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
If you use apache, it should be something like:
|
If you use apache, it should be something like (set in web/.htaccess):
|
||||||
|
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ All your coin's config files need to blocknotify their corresponding stratum usi
|
||||||
|
|
||||||
blocknotify=/var/stratum/blocknotify yaamp.com:port coinid %s
|
blocknotify=/var/stratum/blocknotify yaamp.com:port coinid %s
|
||||||
|
|
||||||
On the website, go to http://server.com/site/frottedessus to login as admin. You have to change it to something different in the code (web/yaamp/modules/site/SiteController.php).
|
On the website, go to http://server.com/site/admintest to login as admin. You have to change it to something different in the code (web/yaamp/modules/site/SiteController.php).
|
||||||
|
|
||||||
There are logs generated in the /var/stratum folder and /var/log/stratum/debug.log for the php log.
|
There are logs generated in the /var/stratum folder and /var/log/stratum/debug.log for the php log.
|
||||||
|
|
||||||
|
|
25
blocknotify/Makefile
Normal file
25
blocknotify/Makefile
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
|
||||||
|
CC=gcc
|
||||||
|
|
||||||
|
CFLAGS=-c -g -I /usr/include/mysql -march=native
|
||||||
|
LDFLAGS=-g
|
||||||
|
|
||||||
|
#CFLAGS=-c -O2 -I /usr/include/mysql
|
||||||
|
#LDFLAGS=-O2
|
||||||
|
|
||||||
|
LDLIBS=-lstdc++
|
||||||
|
|
||||||
|
SOURCES=blocknotify.cpp
|
||||||
|
|
||||||
|
OBJECTS=$(SOURCES:.cpp=.o)
|
||||||
|
OUTPUT=blocknotify
|
||||||
|
|
||||||
|
all: $(SOURCES) $(OUTPUT)
|
||||||
|
|
||||||
|
install: all
|
||||||
|
strip -s $(OUTPUT)
|
||||||
|
cp $(OUTPUT) /usr/local/bin/
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o
|
||||||
|
rm -f $(OUTPUT)
|
0
blocknotify/blocknotify.cpp
Executable file → Normal file
0
blocknotify/blocknotify.cpp
Executable file → Normal file
0
log/.gitignore
vendored
Normal file
0
log/.gitignore
vendored
Normal file
|
@ -1,53 +0,0 @@
|
||||||
|
|
||||||
CC=gcc
|
|
||||||
|
|
||||||
CFLAGS=-c -g -I /usr/include/mysql
|
|
||||||
LDFLAGS=-g
|
|
||||||
|
|
||||||
#CFLAGS=-c -O2 -I /usr/include/mysql
|
|
||||||
#LDFLAGS=-O2
|
|
||||||
|
|
||||||
LDLIBS=iniparser/libiniparser.a algos/libalgos.a sha3/libhash.a -lmysqlclient -lpthread -lm -lstdc++
|
|
||||||
|
|
||||||
SOURCES=stratum.cpp db.cpp coind.cpp coind_aux.cpp coind_template.cpp coind_submit.cpp util.cpp list.cpp \
|
|
||||||
rpc.cpp job.cpp job_send.cpp job_core.cpp merkle.cpp share.cpp socket.cpp coinbase.cpp \
|
|
||||||
client.cpp client_submit.cpp client_core.cpp client_difficulty.cpp remote.cpp remote_template.cpp \
|
|
||||||
user.cpp object.cpp json.cpp base58.cpp
|
|
||||||
|
|
||||||
OBJECTS=$(SOURCES:.cpp=.o)
|
|
||||||
OUTPUT=stratum
|
|
||||||
|
|
||||||
CODEDIR1=algos
|
|
||||||
CODEDIR2=sha3
|
|
||||||
|
|
||||||
.PHONY: projectcode1 projectcode2
|
|
||||||
|
|
||||||
all: projectcode1 projectcode2 $(SOURCES) $(OUTPUT)
|
|
||||||
|
|
||||||
projectcode1:
|
|
||||||
$(MAKE) -C $(CODEDIR1)
|
|
||||||
|
|
||||||
projectcode2:
|
|
||||||
$(MAKE) -C $(CODEDIR2)
|
|
||||||
|
|
||||||
$(SOURCES): stratum.h util.h
|
|
||||||
|
|
||||||
$(OUTPUT): $(OBJECTS)
|
|
||||||
$(CC) $(LDFLAGS) $(OBJECTS) $(LDLIBS) -o $@
|
|
||||||
|
|
||||||
.cpp.o:
|
|
||||||
$(CC) $(CFLAGS) $<
|
|
||||||
|
|
||||||
.c.o:
|
|
||||||
$(CC) $(CFLAGS) $<
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm *.o
|
|
||||||
# rm algos/*.o
|
|
||||||
# rm sha3/*.o
|
|
||||||
|
|
||||||
install: all
|
|
||||||
cp stratum release
|
|
||||||
strip release/stratum
|
|
||||||
|
|
||||||
|
|
10
web/.htaccess
Normal file
10
web/.htaccess
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
RewriteEngine On
|
||||||
|
|
||||||
|
#RewriteCond %{REQUEST_FILENAME} -s [OR]
|
||||||
|
#RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||||
|
#RewriteCond %{REQUEST_FILENAME} -d
|
||||||
|
#RewriteRule ^.*$ - [NC,L]
|
||||||
|
#RewriteRule ^.*$ index.php [NC,L]
|
||||||
|
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteRule ^(.*) index.php?r=$1 [QSA]
|
22
web/.project
22
web/.project
|
@ -1,22 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>web</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.dltk.core.scriptbuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>org.eclipse.php.core.PHPNature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
|
@ -295,7 +295,7 @@ class CErrorHandler extends CApplicationComponent
|
||||||
{
|
{
|
||||||
if(YII_DEBUG)
|
if(YII_DEBUG)
|
||||||
{
|
{
|
||||||
$version='<a href="http://yaamp.com/">yaamp.com</a>';
|
$version='<a href="http://yiimp.ccminer.org/">yiimp.ccminer.org</a>';
|
||||||
if(isset($_SERVER['SERVER_SOFTWARE']))
|
if(isset($_SERVER['SERVER_SOFTWARE']))
|
||||||
$version=$_SERVER['SERVER_SOFTWARE'].' '.$version;
|
$version=$_SERVER['SERVER_SOFTWARE'].' '.$version;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
//define('YII_DEBUG', true);
|
||||||
|
|
||||||
require_once('serverconfig.php');
|
require_once('serverconfig.php');
|
||||||
require_once('yaamp/ui/app.php');
|
require_once('yaamp/ui/app.php');
|
||||||
|
|
||||||
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
|
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||||
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||||
|
|
||||||
|
//$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
if(0)
|
if(0)
|
||||||
{
|
{
|
||||||
debuglog("{$_SERVER['REMOTE_ADDR']}, {$_SERVER['REQUEST_URI']}");
|
debuglog("{$_SERVER['REMOTE_ADDR']}, {$_SERVER['REQUEST_URI']}");
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
ini_set('date.timezone', 'Canada/Eastern');
|
|
||||||
|
|
||||||
define('YAAMP_LOGS', '/var/log/yaamp');
|
|
||||||
define('YAAMP_HTDOCS', '/var/web');
|
|
||||||
|
|
||||||
define('YAAMP_DBHOST', 'localhost');
|
|
||||||
define('YAAMP_DBNAME', 'yaamp');
|
|
||||||
define('YAAMP_DBUSER', 'root');
|
|
||||||
define('YAAMP_DBPASSWORD', 'password');
|
|
||||||
|
|
||||||
define('YAAMP_PRODUCTION', true);
|
|
||||||
define('YAAMP_RENTAL', true);
|
|
||||||
define('YAAMP_LIMIT_ESTIMATE', false);
|
|
||||||
|
|
||||||
define('YAAMP_FEES_MINING', 0.5);
|
|
||||||
define('YAAMP_FEES_EXCHANGE', 2);
|
|
||||||
define('YAAMP_FEES_RENTING', 2);
|
|
||||||
define('YAAMP_PAYMENTS_FREQ', 3*60*60);
|
|
||||||
|
|
||||||
$cold_wallet_table = array(
|
|
||||||
'1C23KmLeCaQSLLyKVykHEUse1R7jRDv9j9' => 0.10,
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
1
web/serverconfig.php
Symbolic link
1
web/serverconfig.php
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
/etc/yamp/serverconfig.php
|
30
web/serverconfig.sample.php
Normal file
30
web/serverconfig.sample.php
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
ini_set('date.timezone', 'Canada/Eastern');
|
||||||
|
|
||||||
|
define('YAAMP_LOGS', '/var/log/yaamp');
|
||||||
|
define('YAAMP_HTDOCS', '/var/web');
|
||||||
|
|
||||||
|
define('YAAMP_DBHOST', 'localhost');
|
||||||
|
define('YAAMP_DBNAME', 'yaamp');
|
||||||
|
define('YAAMP_DBUSER', 'root');
|
||||||
|
define('YAAMP_DBPASSWORD', 'password');
|
||||||
|
|
||||||
|
define('YAAMP_PRODUCTION', true);
|
||||||
|
define('YAAMP_RENTAL', true);
|
||||||
|
define('YAAMP_LIMIT_ESTIMATE', false);
|
||||||
|
|
||||||
|
define('YAAMP_FEES_MINING', 0.5);
|
||||||
|
define('YAAMP_FEES_EXCHANGE', 2);
|
||||||
|
define('YAAMP_FEES_RENTING', 2);
|
||||||
|
define('YAAMP_PAYMENTS_FREQ', 3*60*60);
|
||||||
|
|
||||||
|
define('YAAMP_BTCADDRESS', '1Auhps1mHZQpoX4mCcVL8odU81VakZQ6dR');
|
||||||
|
define('YAAMP_SITE_URL', 'yiimp.ccminer.org');
|
||||||
|
define('YAAMP_ADMIN_EMAIL', 'yiimp@spam.la');
|
||||||
|
|
||||||
|
$cold_wallet_table = array(
|
||||||
|
'1C23KmLeCaQSLLyKVykHEUse1R7jRDv9j9' => 0.10,
|
||||||
|
);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'name'=>'yaamp.com',
|
'name'=>YAAMP_SITE_URL,
|
||||||
|
|
||||||
'defaultController'=>'site',
|
'defaultController'=>'site',
|
||||||
'layout'=>'main',
|
'layout'=>'main',
|
||||||
|
@ -14,25 +14,31 @@ return array(
|
||||||
'preload'=>array('log'),
|
'preload'=>array('log'),
|
||||||
'import'=>array('application.components.*'),
|
'import'=>array('application.components.*'),
|
||||||
// 'params'=>require("siteconfig.php"),
|
// 'params'=>require("siteconfig.php"),
|
||||||
|
|
||||||
'components'=>array(
|
'components'=>array(
|
||||||
|
|
||||||
'urlManager'=>array(
|
'urlManager'=>array(
|
||||||
'urlFormat'=>'path',
|
'urlFormat'=>'path',
|
||||||
'showScriptName'=>false,
|
'showScriptName'=>false,
|
||||||
'appendParams'=>false,
|
'appendParams'=>false,
|
||||||
|
'caseSensitive'=>false,
|
||||||
|
'rules'=>array(
|
||||||
|
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
|
||||||
|
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
|
||||||
|
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
'assetManager'=>array(
|
'assetManager'=>array(
|
||||||
'basePath'=>YAAMP_HTDOCS."/assets"),
|
'basePath'=>YAAMP_HTDOCS."/assets"),
|
||||||
|
|
||||||
'log'=>array(
|
'log'=>array(
|
||||||
'class'=>'CLogRouter',
|
'class'=>'CLogRouter',
|
||||||
'routes'=>array(
|
'routes'=>array(
|
||||||
array(
|
array(
|
||||||
'class'=>'CFileLogRoute',
|
'class'=>'CFileLogRoute',
|
||||||
'levels'=>'error, warning',
|
'levels'=>'error, warning',
|
||||||
// 'levels'=>'trace, error, warning',
|
// 'levels'=>'debug, trace, error, warning',
|
||||||
),
|
),
|
||||||
// array(
|
// array(
|
||||||
// 'class'=>'CProfileLogRoute',
|
// 'class'=>'CProfileLogRoute',
|
||||||
|
@ -49,16 +55,16 @@ return array(
|
||||||
'db'=>array(
|
'db'=>array(
|
||||||
'class'=>'CDbConnection',
|
'class'=>'CDbConnection',
|
||||||
'connectionString'=>"mysql:host=".YAAMP_DBHOST.";dbname=".YAAMP_DBNAME,
|
'connectionString'=>"mysql:host=".YAAMP_DBHOST.";dbname=".YAAMP_DBNAME,
|
||||||
|
|
||||||
'username'=>YAAMP_DBUSER,
|
'username'=>YAAMP_DBUSER,
|
||||||
'password'=>YAAMP_DBPASSWORD,
|
'password'=>YAAMP_DBPASSWORD,
|
||||||
|
|
||||||
'enableProfiling'=>false,
|
'enableProfiling'=>false,
|
||||||
'charset'=>'utf8',
|
'charset'=>'utf8',
|
||||||
'schemaCachingDuration'=>3600,
|
'schemaCachingDuration'=>3600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -226,7 +226,7 @@ function MonitorBTC()
|
||||||
|
|
||||||
$txurl = "https://blockchain.info/tx/{$transaction['txid']}";
|
$txurl = "https://blockchain.info/tx/{$transaction['txid']}";
|
||||||
|
|
||||||
$b = mail('yaamp201@gmail.com', "withdraw {$transaction['amount']}",
|
$b = mail(YAAMP_ADMIN_EMAIL, "withdraw {$transaction['amount']}",
|
||||||
"<a href='$txurl'>{$transaction['address']}</a>");
|
"<a href='$txurl'>{$transaction['address']}</a>");
|
||||||
|
|
||||||
if(!$b) debuglog('error sending email');
|
if(!$b) debuglog('error sending email');
|
||||||
|
|
|
@ -96,7 +96,7 @@ function updateRawCoin($marketname, $symbol, $name='unknown')
|
||||||
$coin->created = time();
|
$coin->created = time();
|
||||||
$coin->save();
|
$coin->save();
|
||||||
|
|
||||||
mail('yaamp201@gmail.com', "New coin $symbol", "new coin $symbol ($name) on $marketname");
|
mail(YAAMP_ADMIN_EMAIL, "New coin $symbol", "new coin $symbol ($name) on $marketname");
|
||||||
sleep(30);
|
sleep(30);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,14 +10,18 @@ function BackendUpdateServices()
|
||||||
2=>'scryptn',
|
2=>'scryptn',
|
||||||
3=>'x11',
|
3=>'x11',
|
||||||
4=>'x13',
|
4=>'x13',
|
||||||
|
5=>'keccak',
|
||||||
6=>'x15',
|
6=>'x15',
|
||||||
7=>'nist5',
|
7=>'nist5',
|
||||||
8=>'neoscrypt',
|
8=>'neoscrypt',
|
||||||
9=>'lyra2',
|
9=>'lyra2',
|
||||||
|
10=>'whirlx',
|
||||||
11=>'qubit',
|
11=>'qubit',
|
||||||
12=>'quark',
|
12=>'quark',
|
||||||
|
|
||||||
|
111=>'c11',
|
||||||
);
|
);
|
||||||
|
|
||||||
$res = fetch_url('https://www.nicehash.com/api?method=stats.global.current');
|
$res = fetch_url('https://www.nicehash.com/api?method=stats.global.current');
|
||||||
if(!$res) return;
|
if(!$res) return;
|
||||||
|
|
||||||
|
|
|
@ -242,7 +242,7 @@ function BackendRunCoinActions()
|
||||||
// fclose($file);
|
// fclose($file);
|
||||||
|
|
||||||
// controller()->memcache->set('stratum_log_size', $filesize);
|
// controller()->memcache->set('stratum_log_size', $filesize);
|
||||||
// system("echo \"$data\" | mail -s \"yaamp server\" yaamp201@gmail.com");
|
// system("echo \"$data\" | mail -s \"yiimp server\" ".YAAMP_ADMIN_EMAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ function bu($url=null)
|
||||||
{
|
{
|
||||||
static $baseUrl;
|
static $baseUrl;
|
||||||
if ($baseUrl===null)
|
if ($baseUrl===null)
|
||||||
$baseUrl=Yii::app()->request->baseUrl;
|
$baseUrl=Yii::app()->request->baseUrl;
|
||||||
return $url===null ? $baseUrl : $baseUrl.'/'.ltrim($url,'/');
|
return $url===null ? $baseUrl : $baseUrl.'/'.ltrim($url,'/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,11 +50,11 @@ function user()
|
||||||
{
|
{
|
||||||
return Yii::app()->user;
|
return Yii::app()->user;
|
||||||
}
|
}
|
||||||
|
|
||||||
function now()
|
function now()
|
||||||
{
|
{
|
||||||
return date("Y-m-d H:i:s");
|
return date("Y-m-d H:i:s");
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -72,6 +72,6 @@ function JavascriptReady($javascript)
|
||||||
{
|
{
|
||||||
echo "<script>$(function(){ $javascript})</script>";
|
echo "<script>$(function(){ $javascript})</script>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@ function send_email_alert($name, $title, $message, $t=10)
|
||||||
$last = memcache_get(controller()->memcache->memcache, "last_email_sent_$name");
|
$last = memcache_get(controller()->memcache->memcache, "last_email_sent_$name");
|
||||||
if($last + $t*60 > time()) return;
|
if($last + $t*60 > time()) return;
|
||||||
|
|
||||||
debuglog("mail('yaamp201@gmail.com', $title, ...)");
|
debuglog("mail('".YAAMP_ADMIN_EMAIL."', $title, ...)");
|
||||||
|
|
||||||
$b = mail('yaamp201@gmail.com', $title, $message);
|
$b = mail(YAAMP_ADMIN_EMAIL, $title, $message);
|
||||||
if(!$b) debuglog('error sending email');
|
if(!$b) debuglog('error sending email');
|
||||||
|
|
||||||
memcache_set(controller()->memcache->memcache, "last_email_sent_$name", time());
|
memcache_set(controller()->memcache->memcache, "last_email_sent_$name", time());
|
||||||
|
|
0
web/yaamp/core/exchange/bittrex.php
Executable file → Normal file
0
web/yaamp/core/exchange/bittrex.php
Executable file → Normal file
0
web/yaamp/core/exchange/bleutrade.php
Executable file → Normal file
0
web/yaamp/core/exchange/bleutrade.php
Executable file → Normal file
0
web/yaamp/core/exchange/ccexapi.php
Executable file → Normal file
0
web/yaamp/core/exchange/ccexapi.php
Executable file → Normal file
0
web/yaamp/core/exchange/cryptsy.php
Executable file → Normal file
0
web/yaamp/core/exchange/cryptsy.php
Executable file → Normal file
0
web/yaamp/core/exchange/jubi.php
Executable file → Normal file
0
web/yaamp/core/exchange/jubi.php
Executable file → Normal file
0
web/yaamp/core/exchange/poloniex.php
Executable file → Normal file
0
web/yaamp/core/exchange/poloniex.php
Executable file → Normal file
0
web/yaamp/core/exchange/yobit.php
Executable file → Normal file
0
web/yaamp/core/exchange/yobit.php
Executable file → Normal file
|
@ -1,198 +1,199 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// $order
|
// $order
|
||||||
// orderid
|
// orderid
|
||||||
// price
|
// price
|
||||||
// amount
|
// amount
|
||||||
// marketid (cryptsy)
|
// marketid (cryptsy)
|
||||||
//
|
//
|
||||||
|
|
||||||
class CExchange
|
class CExchange
|
||||||
{
|
{
|
||||||
protected $marketname;
|
protected $marketname;
|
||||||
|
|
||||||
protected $orders;
|
protected $orders;
|
||||||
protected $balances;
|
protected $balances;
|
||||||
|
|
||||||
protected $balance_btc;
|
protected $balance_btc;
|
||||||
protected $balance_ltc;
|
protected $balance_ltc;
|
||||||
|
|
||||||
abstract protected function loadOrders();
|
abstract protected function loadOrders();
|
||||||
abstract protected function loadBalances();
|
abstract protected function loadBalances();
|
||||||
abstract protected function withdraw();
|
abstract protected function withdraw();
|
||||||
|
|
||||||
protected function get_mintrade() {return 0.00050000;}
|
protected function get_mintrade() {return 0.00050000;}
|
||||||
protected function get_minwithdraw() {return 0.25000000;}
|
protected function get_minwithdraw() {return 0.25000000;}
|
||||||
|
|
||||||
public function __construct($marketname)
|
public function __construct($marketname)
|
||||||
{
|
{
|
||||||
$this->marketname = $marketname;
|
$this->marketname = $marketname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function doTrading()
|
public function doTrading()
|
||||||
{
|
{
|
||||||
$this->orders = $this->loadOrders();
|
$this->orders = $this->loadOrders();
|
||||||
foreach($this->orders as $order)
|
foreach($this->orders as $order)
|
||||||
{
|
{
|
||||||
$cexcoin = new CExchangeCoin($order->coin, $this->marketname);
|
$cexcoin = new CExchangeCoin($order->coin, $this->marketname);
|
||||||
// cancel if too high
|
// cancel if too high
|
||||||
// add to our db if not there already
|
// add to our db if not there already
|
||||||
}
|
}
|
||||||
|
|
||||||
$list = getdbolist('db_orders', "market='$this->marketname'");
|
$list = getdbolist('db_orders', "market='$this->marketname'");
|
||||||
foreach($list as $db_order)
|
foreach($list as $db_order)
|
||||||
{
|
{
|
||||||
$found = false;
|
$found = false;
|
||||||
foreach($this->orders as $order)
|
foreach($this->orders as $order)
|
||||||
{
|
{
|
||||||
if($order->orderid == $db_order->uuid)
|
if($order->orderid == $db_order->uuid)
|
||||||
{
|
{
|
||||||
$found = true;
|
$found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$found)
|
if(!$found)
|
||||||
{
|
{
|
||||||
debuglog("$this->marketname deleting order");
|
debuglog("$this->marketname deleting order");
|
||||||
$db_order->delete();
|
$db_order->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$savebalance = getdbosql('db_balances', "name='cryptsy'");
|
$savebalance = getdbosql('db_balances', "name='cryptsy'");
|
||||||
$savebalance->balance = 0;
|
$savebalance->balance = 0;
|
||||||
|
|
||||||
$this->balances = $this->loadBalances();
|
$this->balances = $this->loadBalances();
|
||||||
foreach($this->balances as $balance)
|
foreach($this->balances as $balance)
|
||||||
{
|
{
|
||||||
if($balance->amount <= 0) continue;
|
if($balance->amount <= 0) continue;
|
||||||
$cexcoin = new CExchangeCoin($balance->coin, $this->marketname);
|
$cexcoin = new CExchangeCoin($balance->coin, $this->marketname);
|
||||||
|
|
||||||
foreach($cexcoin->bids as $bid)
|
foreach($cexcoin->bids as $bid)
|
||||||
{
|
{
|
||||||
if($balance->amount*1.5 < $bid->amount && !$coin->sellonbid) break;
|
if($balance->amount*1.5 < $bid->amount && !$coin->sellonbid) break;
|
||||||
|
|
||||||
$sellamount = min($balance->amount, $bid->price);
|
$sellamount = min($balance->amount, $bid->price);
|
||||||
if($sellamount*$bid->price < $this->get_mintrade()) continue;
|
if($sellamount*$bid->price < $this->get_mintrade()) continue;
|
||||||
|
|
||||||
$cex->sell($sellamount, $bid->price);
|
$cex->sell($sellamount, $bid->price);
|
||||||
$balance->amount -= $sellamount;
|
$balance->amount -= $sellamount;
|
||||||
|
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cexcoin = new CExchangeCoin($balance->coin, $this->marketname);
|
$cexcoin = new CExchangeCoin($balance->coin, $this->marketname);
|
||||||
if($balance->amount*$cexcoin->ask < $this->get_mintrade()) continue;
|
if($balance->amount*$cexcoin->ask < $this->get_mintrade()) continue;
|
||||||
|
|
||||||
$cex->sell($balance->amount, $cexcoin->ask);
|
$cex->sell($balance->amount, $cexcoin->ask);
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->balance_btc >= $this->get_minwithdraw())
|
if($this->balance_btc >= $this->get_minwithdraw())
|
||||||
{
|
{
|
||||||
debuglog("withdraw $this->marketname $this->balance_btc");
|
debuglog("withdraw $this->marketname $this->balance_btc");
|
||||||
$this->withdraw($this->balance_btc);
|
$this->withdraw($this->balance_btc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class CExchangeCryptsy extends CExchange
|
class CExchangeCryptsy extends CExchange
|
||||||
{
|
{
|
||||||
protected function loadOrders()
|
protected function loadOrders()
|
||||||
{
|
{
|
||||||
$ordertab = array();
|
$ordertab = array();
|
||||||
|
|
||||||
$orders = cryptsy_api_query('allmyorders');
|
$orders = cryptsy_api_query('allmyorders');
|
||||||
if(!$orders) return $ordertab;
|
if(!$orders) return $ordertab;
|
||||||
if(!isset($orders['return'])) return $ordertab;
|
if(!isset($orders['return'])) return $ordertab;
|
||||||
|
|
||||||
foreach($orders['return'] as $order)
|
foreach($orders['return'] as $order)
|
||||||
{
|
{
|
||||||
if(!isset($order['marketid'])) continue;
|
if(!isset($order['marketid'])) continue;
|
||||||
if(!isset($order['orderid'])) continue;
|
if(!isset($order['orderid'])) continue;
|
||||||
|
|
||||||
$object = new object();
|
$object = new object();
|
||||||
$object->orderid = $order['orderid'];
|
$object->orderid = $order['orderid'];
|
||||||
$object->price = $order['price'];
|
$object->price = $order['price'];
|
||||||
$object->amount = $order['quantity'];
|
$object->amount = $order['quantity'];
|
||||||
$object->marketid = $order['marketid'];
|
$object->marketid = $order['marketid'];
|
||||||
|
|
||||||
$market = getdbosql('db_markets', "marketid=$object->marketid");
|
$market = getdbosql('db_markets', "marketid=$object->marketid");
|
||||||
if(!$market) continue;
|
if(!$market) continue;
|
||||||
|
|
||||||
$object->coin = getdbo('db_coins', $market->coinid);
|
$object->coin = getdbo('db_coins', $market->coinid);
|
||||||
if(!$object->coin) continue;
|
if(!$object->coin) continue;
|
||||||
|
|
||||||
$ordertab[] = $object;
|
$ordertab[] = $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ordertab;
|
return $ordertab;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function loadBalances()
|
protected function loadBalances()
|
||||||
{
|
{
|
||||||
$balancetab = array();
|
$balancetab = array();
|
||||||
|
|
||||||
$balances = cryptsy_api_query('getinfo');
|
$balances = cryptsy_api_query('getinfo');
|
||||||
if(!$balances) return;
|
if(!$balances) return;
|
||||||
if(!isset($balances['return']))
|
if(!isset($balances['return']))
|
||||||
{
|
{
|
||||||
debuglog($balances);
|
debuglog($balances);
|
||||||
return $balancetab;
|
return $balancetab;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($balances['return']['balances_available'] as $symbol=>$balance)
|
foreach($balances['return']['balances_available'] as $symbol=>$balance)
|
||||||
{
|
{
|
||||||
$balance = floatval($balance);
|
$balance = floatval($balance);
|
||||||
|
|
||||||
if($symbol == 'Points') continue;
|
if($symbol == 'Points') continue;
|
||||||
if($symbol == 'BTC')
|
if($symbol == 'BTC')
|
||||||
{
|
{
|
||||||
$this->balance_btc = floatval($balance);
|
$this->balance_btc = floatval($balance);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($symbol == 'LTC')
|
if($symbol == 'LTC')
|
||||||
{
|
{
|
||||||
$this->balance_ltc = floatval($balance);
|
$this->balance_ltc = floatval($balance);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$balance) continue;
|
if(!$balance) continue;
|
||||||
|
|
||||||
$object = new object();
|
$object = new object();
|
||||||
$object->balance = $balance;
|
$object->balance = $balance;
|
||||||
|
|
||||||
$object->coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$symbol));
|
$object->coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$symbol));
|
||||||
if(!$object->coin) continue;
|
if(!$object->coin) continue;
|
||||||
|
|
||||||
$balancetab[] = $object;
|
$balancetab[] = $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $balancetab;
|
return $balancetab;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function withdraw($amount)
|
protected function withdraw($amount)
|
||||||
{
|
{
|
||||||
$res = cryptsy_api_query('makewithdrawal', array('address'=>'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9', 'amount'=>$amount));
|
$btcaddr = YAAMP_BTCADDRESS; //'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9';
|
||||||
debuglog($res);
|
$res = cryptsy_api_query('makewithdrawal', array('address'=>$btcaddr, 'amount'=>$amount));
|
||||||
|
debuglog($res);
|
||||||
if($res && $res['success'])
|
|
||||||
{
|
if($res && $res['success'])
|
||||||
$withdraw = new db_withdraws;
|
{
|
||||||
$withdraw->market = 'cryptsy';
|
$withdraw = new db_withdraws;
|
||||||
$withdraw->address = '14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9';
|
$withdraw->market = 'cryptsy';
|
||||||
$withdraw->amount = $amount;
|
$withdraw->address = $btcaddr;
|
||||||
$withdraw->time = time();
|
$withdraw->amount = $amount;
|
||||||
$withdraw->save();
|
$withdraw->time = time();
|
||||||
}
|
$withdraw->save();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,84 +1,84 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class CExchangeCoin
|
class CExchangeCoin
|
||||||
{
|
{
|
||||||
public $marketname;
|
public $marketname;
|
||||||
|
|
||||||
public $coin;
|
public $coin;
|
||||||
public $market;
|
public $market;
|
||||||
|
|
||||||
public $bid;
|
public $bid;
|
||||||
public $ask;
|
public $ask;
|
||||||
|
|
||||||
public $bids;
|
public $bids;
|
||||||
public $asks;
|
public $asks;
|
||||||
|
|
||||||
abstract protected function load();
|
abstract protected function load();
|
||||||
abstract protected function sell($amount, $price);
|
abstract protected function sell($amount, $price);
|
||||||
abstract protected function cancel();
|
abstract protected function cancel();
|
||||||
|
|
||||||
//////
|
//////
|
||||||
|
|
||||||
public function __construct($coin, $marketname)
|
public function __construct($coin, $marketname)
|
||||||
{
|
{
|
||||||
$this->coin = $coin;
|
$this->coin = $coin;
|
||||||
$this->marketname = $marketname;
|
$this->marketname = $marketname;
|
||||||
|
|
||||||
$this->market = getdbosql('db_markets', "coinid=$coin->id and name='$marketname'");
|
$this->market = getdbosql('db_markets', "coinid=$coin->id and name='$marketname'");
|
||||||
if(!$this->market) return;
|
if(!$this->market) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function create($coin, $marketname)
|
public static function create($coin, $marketname)
|
||||||
{
|
{
|
||||||
switch($marketname)
|
switch($marketname)
|
||||||
{
|
{
|
||||||
case 'cryptsy':
|
case 'cryptsy':
|
||||||
$cexcoin = new CExchangeCoinCryptsy($coin, $marketname);
|
$cexcoin = new CExchangeCoinCryptsy($coin, $marketname);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cexcoin->load();
|
$cexcoin->load();
|
||||||
return $cexcoin;
|
return $cexcoin;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CExchangeCoinCryptsy extends CExchangeCoin
|
class CExchangeCoinCryptsy extends CExchangeCoin
|
||||||
{
|
{
|
||||||
private $marketid;
|
private $marketid;
|
||||||
|
|
||||||
protected function load()
|
protected function load()
|
||||||
{
|
{
|
||||||
$ticker = getCryptsyTicker($market->marketid);
|
$ticker = getCryptsyTicker($market->marketid);
|
||||||
if(!$ticker || !isset($ticker->return->$symbol->sellorders[0])) continue;
|
if(!$ticker || !isset($ticker->return->$symbol->sellorders[0])) continue;
|
||||||
|
|
||||||
///
|
///
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function sell($amount, $price)
|
protected function sell($amount, $price)
|
||||||
{
|
{
|
||||||
$res = cryptsy_api_query('createorder',
|
$res = cryptsy_api_query('createorder',
|
||||||
array('marketid'=>$this->marketid, 'ordertype'=>'Sell', 'quantity'=>$amount, 'price'=>$price));
|
array('marketid'=>$this->marketid, 'ordertype'=>'Sell', 'quantity'=>$amount, 'price'=>$price));
|
||||||
if(!$res || !isset($res['orderid'])) return;
|
if(!$res || !isset($res['orderid'])) return;
|
||||||
|
|
||||||
$db_order = new db_orders;
|
$db_order = new db_orders;
|
||||||
$db_order->market = 'cryptsy';
|
$db_order->market = 'cryptsy';
|
||||||
$db_order->coinid = $this->coin->id;
|
$db_order->coinid = $this->coin->id;
|
||||||
$db_order->amount = $balance;
|
$db_order->amount = $balance;
|
||||||
$db_order->price = $sellprice;
|
$db_order->price = $sellprice;
|
||||||
$db_order->ask = $price;
|
$db_order->ask = $price;
|
||||||
$db_order->bid = $price;
|
$db_order->bid = $price;
|
||||||
$db_order->uuid = $res['orderid'];
|
$db_order->uuid = $res['orderid'];
|
||||||
$db_order->created = time();
|
$db_order->created = time();
|
||||||
$db_order->save();
|
$db_order->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function cancel($amount, $price)
|
protected function cancel($amount, $price)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once("CExchange.php");
|
require_once("CExchange.php");
|
||||||
require_once("CExchangeCoin.php");
|
require_once("CExchangeCoin.php");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ function processUrlKeyword($meta, $keyname, $fieldname, $attribute,
|
||||||
function processUrl($url)
|
function processUrl($url)
|
||||||
{
|
{
|
||||||
libxml_use_internal_errors(true);
|
libxml_use_internal_errors(true);
|
||||||
|
|
||||||
$html = @file_get_contents_curl($url);
|
$html = @file_get_contents_curl($url);
|
||||||
if(!$html)
|
if(!$html)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
function yaamp_get_algos()
|
function yaamp_get_algos()
|
||||||
{
|
{
|
||||||
return array('sha256', 'scrypt', 'scryptn', 'neoscrypt', 'quark', 'lyra2', 'qubit', 'x11', 'x13', 'x15');
|
return array('sha256', 'scrypt', 'scryptn', 'neoscrypt', 'quark', 'lyra2', 'qubit', 'c11', 'x11', 'x13', 'x15');
|
||||||
}
|
}
|
||||||
|
|
||||||
function yaamp_get_algo_norm($algo)
|
function yaamp_get_algo_norm($algo)
|
||||||
|
@ -11,6 +11,7 @@ function yaamp_get_algo_norm($algo)
|
||||||
// 'sha256' => 1,
|
// 'sha256' => 1,
|
||||||
'scrypt' => 1,
|
'scrypt' => 1,
|
||||||
'scryptn' => 0.5,
|
'scryptn' => 0.5,
|
||||||
|
'c11' => 5.5,
|
||||||
'x11' => 5.5,
|
'x11' => 5.5,
|
||||||
'x13' => 3.9,
|
'x13' => 3.9,
|
||||||
'x14' => 3.7,
|
'x14' => 3.7,
|
||||||
|
@ -41,6 +42,7 @@ function getAlgoColors($algo)
|
||||||
'scrypt' => '#c0c0e0',
|
'scrypt' => '#c0c0e0',
|
||||||
'neoscrypt' => '#a0d0f0',
|
'neoscrypt' => '#a0d0f0',
|
||||||
'scryptn' => '#d0d0d0',
|
'scryptn' => '#d0d0d0',
|
||||||
|
'c11' => '#f0b0b0',
|
||||||
'x11' => '#f0f0a0',
|
'x11' => '#f0f0a0',
|
||||||
'x13' => '#d0f0c0',
|
'x13' => '#d0f0c0',
|
||||||
'x14' => '#a0f0c0',
|
'x14' => '#a0f0c0',
|
||||||
|
@ -62,6 +64,7 @@ function getAlgoPort($algo)
|
||||||
$a = array(
|
$a = array(
|
||||||
'sha256' => 3333,
|
'sha256' => 3333,
|
||||||
'scrypt' => 3433,
|
'scrypt' => 3433,
|
||||||
|
'c11' => 3573,
|
||||||
'x11' => 3533,
|
'x11' => 3533,
|
||||||
'x13' => 3633,
|
'x13' => 3633,
|
||||||
'x15' => 3733,
|
'x15' => 3733,
|
||||||
|
|
|
@ -187,19 +187,20 @@ function doBittrexTrading($quick=false)
|
||||||
|
|
||||||
if($savebalance->balance >= 0.3)
|
if($savebalance->balance >= 0.3)
|
||||||
{
|
{
|
||||||
|
$btcaddr = YAAMP_BTCADDRESS; //'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9';
|
||||||
$amount = $savebalance->balance; // - 0.0002;
|
$amount = $savebalance->balance; // - 0.0002;
|
||||||
debuglog("bittrex withdraw $amount to 14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9");
|
debuglog("bittrex withdraw $amount to $btcaddr");
|
||||||
|
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
$res = bittrex_api_query('account/withdraw', "¤cy=BTC&quantity=$amount&address=14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9");
|
$res = bittrex_api_query('account/withdraw', "¤cy=BTC&quantity=$amount&address=$btcaddr");
|
||||||
debuglog($res);
|
debuglog($res);
|
||||||
|
|
||||||
if($res && $res->success)
|
if($res && $res->success)
|
||||||
{
|
{
|
||||||
$withdraw = new db_withdraws;
|
$withdraw = new db_withdraws;
|
||||||
$withdraw->market = 'bittrex';
|
$withdraw->market = 'bittrex';
|
||||||
$withdraw->address = '14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9';
|
$withdraw->address = $btcaddr;
|
||||||
$withdraw->amount = $amount;
|
$withdraw->amount = $amount;
|
||||||
$withdraw->time = time();
|
$withdraw->time = time();
|
||||||
$withdraw->uuid = $res->result->uuid;
|
$withdraw->uuid = $res->result->uuid;
|
||||||
|
|
|
@ -184,19 +184,21 @@ function doBleutradeTrading($quick=false)
|
||||||
|
|
||||||
if($savebalance->balance >= 0.2)
|
if($savebalance->balance >= 0.2)
|
||||||
{
|
{
|
||||||
|
$btcaddr = YAAMP_BTCADDRESS; //'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9';
|
||||||
|
|
||||||
$amount = $savebalance->balance; // - 0.0002;
|
$amount = $savebalance->balance; // - 0.0002;
|
||||||
debuglog("bleutrade withdraw $amount to 14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9");
|
debuglog("bleutrade withdraw $amount to $btcaddr");
|
||||||
|
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
$res = bleutrade_api_query('account/withdraw', "¤cy=BTC&quantity=$amount&address=14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9");
|
$res = bleutrade_api_query('account/withdraw', "¤cy=BTC&quantity=$amount&address=$btcaddr");
|
||||||
debuglog($res);
|
debuglog($res);
|
||||||
|
|
||||||
if($res && $res->success)
|
if($res && $res->success)
|
||||||
{
|
{
|
||||||
$withdraw = new db_withdraws;
|
$withdraw = new db_withdraws;
|
||||||
$withdraw->market = 'bleutrade';
|
$withdraw->market = 'bleutrade';
|
||||||
$withdraw->address = '14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9';
|
$withdraw->address = $btcaddr;
|
||||||
$withdraw->amount = $amount;
|
$withdraw->amount = $amount;
|
||||||
$withdraw->time = time();
|
$withdraw->time = time();
|
||||||
$withdraw->uuid = $res->result->orderid;
|
$withdraw->uuid = $res->result->orderid;
|
||||||
|
|
|
@ -196,20 +196,22 @@ function doCryptsyTrading($quick=false)
|
||||||
|
|
||||||
if($savebalance->balance >= 0.3)
|
if($savebalance->balance >= 0.3)
|
||||||
{
|
{
|
||||||
|
$btcaddr = YAAMP_BTCADDRESS; //'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9';
|
||||||
|
|
||||||
$amount = $savebalance->balance; // - 0.001;
|
$amount = $savebalance->balance; // - 0.001;
|
||||||
debuglog("cryptsy withdraw $amount to 14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9");
|
debuglog("cryptsy withdraw $amount to $btcaddr");
|
||||||
|
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
$res = cryptsy_api_query('makewithdrawal',
|
$res = cryptsy_api_query('makewithdrawal',
|
||||||
array('address'=>'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9', 'amount'=>$amount));
|
array('address'=>$btcaddr, 'amount'=>$amount));
|
||||||
|
|
||||||
debuglog($res);
|
debuglog($res);
|
||||||
if($res && $res['success'])
|
if($res && $res['success'])
|
||||||
{
|
{
|
||||||
$withdraw = new db_withdraws;
|
$withdraw = new db_withdraws;
|
||||||
$withdraw->market = 'cryptsy';
|
$withdraw->market = 'cryptsy';
|
||||||
$withdraw->address = '14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9';
|
$withdraw->address = $btcaddr;
|
||||||
$withdraw->amount = $amount;
|
$withdraw->amount = $amount;
|
||||||
$withdraw->time = time();
|
$withdraw->time = time();
|
||||||
// $withdraw->uuid = $res->result->uuid;
|
// $withdraw->uuid = $res->result->uuid;
|
||||||
|
|
|
@ -1,179 +1,181 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function doPoloniexTrading()
|
function doPoloniexTrading()
|
||||||
{
|
{
|
||||||
// debuglog('-------------- doPoloniexTrading()');
|
// debuglog('-------------- doPoloniexTrading()');
|
||||||
|
|
||||||
$flushall = rand(0, 4) == 0;
|
$flushall = rand(0, 4) == 0;
|
||||||
$poloniex = new poloniex;
|
$poloniex = new poloniex;
|
||||||
|
|
||||||
$tickers = $poloniex->get_ticker();
|
$tickers = $poloniex->get_ticker();
|
||||||
if(!$tickers) return;
|
if(!$tickers) return;
|
||||||
|
|
||||||
// upgrade orders
|
// upgrade orders
|
||||||
$coins = getdbolist('db_coins', "enable and id in (select distinct coinid from markets where name='poloniex')");
|
$coins = getdbolist('db_coins', "enable and id in (select distinct coinid from markets where name='poloniex')");
|
||||||
foreach($coins as $coin)
|
foreach($coins as $coin)
|
||||||
{
|
{
|
||||||
if($coin->dontsell) continue;
|
if($coin->dontsell) continue;
|
||||||
$pair = "BTC_$coin->symbol";
|
$pair = "BTC_$coin->symbol";
|
||||||
if(!isset($tickers[$pair])) continue;
|
if(!isset($tickers[$pair])) continue;
|
||||||
|
|
||||||
$orders = $poloniex->get_open_orders($pair);
|
$orders = $poloniex->get_open_orders($pair);
|
||||||
if(!$orders || !isset($orders[0]))
|
if(!$orders || !isset($orders[0]))
|
||||||
{
|
{
|
||||||
dborun("delete from orders where coinid=$coin->id and market='poloniex'");
|
dborun("delete from orders where coinid=$coin->id and market='poloniex'");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($orders as $order)
|
foreach($orders as $order)
|
||||||
{
|
{
|
||||||
if(!isset($order['orderNumber']))
|
if(!isset($order['orderNumber']))
|
||||||
{
|
{
|
||||||
debuglog($order);
|
debuglog($order);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($order['rate'] > $tickers[$pair]['lowestAsk']+0.00000005 || $flushall)
|
if($order['rate'] > $tickers[$pair]['lowestAsk']+0.00000005 || $flushall)
|
||||||
{
|
{
|
||||||
// debuglog("poloniex cancel order for $pair {$order['orderNumber']}");
|
// debuglog("poloniex cancel order for $pair {$order['orderNumber']}");
|
||||||
$poloniex->cancel_order($pair, $order['orderNumber']);
|
$poloniex->cancel_order($pair, $order['orderNumber']);
|
||||||
|
|
||||||
$db_order = getdbosql('db_orders', "uuid=:uuid", array(':uuid'=>$order['orderNumber']));
|
$db_order = getdbosql('db_orders', "uuid=:uuid", array(':uuid'=>$order['orderNumber']));
|
||||||
if($db_order) $db_order->delete();
|
if($db_order) $db_order->delete();
|
||||||
|
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db_order = getdbosql('db_orders', "uuid=:uuid", array(':uuid'=>$order['orderNumber']));
|
$db_order = getdbosql('db_orders', "uuid=:uuid", array(':uuid'=>$order['orderNumber']));
|
||||||
if($db_order) continue;
|
if($db_order) continue;
|
||||||
|
|
||||||
debuglog("poloniex adding order $coin->symbol");
|
debuglog("poloniex adding order $coin->symbol");
|
||||||
|
|
||||||
$db_order = new db_orders;
|
$db_order = new db_orders;
|
||||||
$db_order->market = 'poloniex';
|
$db_order->market = 'poloniex';
|
||||||
$db_order->coinid = $coin->id;
|
$db_order->coinid = $coin->id;
|
||||||
$db_order->amount = $order['amount'];
|
$db_order->amount = $order['amount'];
|
||||||
$db_order->price = $order['rate'];
|
$db_order->price = $order['rate'];
|
||||||
$db_order->ask = $tickers[$pair]['lowestAsk'];
|
$db_order->ask = $tickers[$pair]['lowestAsk'];
|
||||||
$db_order->bid = $tickers[$pair]['highestBid'];
|
$db_order->bid = $tickers[$pair]['highestBid'];
|
||||||
$db_order->uuid = $order['orderNumber'];
|
$db_order->uuid = $order['orderNumber'];
|
||||||
$db_order->created = time();
|
$db_order->created = time();
|
||||||
$db_order->save();
|
$db_order->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$list = getdbolist('db_orders', "coinid=$coin->id and market='poloniex'");
|
$list = getdbolist('db_orders', "coinid=$coin->id and market='poloniex'");
|
||||||
foreach($list as $db_order)
|
foreach($list as $db_order)
|
||||||
{
|
{
|
||||||
$found = false;
|
$found = false;
|
||||||
foreach($orders as $order)
|
foreach($orders as $order)
|
||||||
{
|
{
|
||||||
if(!isset($order['orderNumber']))
|
if(!isset($order['orderNumber']))
|
||||||
{
|
{
|
||||||
debuglog($order);
|
debuglog($order);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($order['orderNumber'] == $db_order->uuid)
|
if($order['orderNumber'] == $db_order->uuid)
|
||||||
{
|
{
|
||||||
$found = true;
|
$found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$found)
|
if(!$found)
|
||||||
{
|
{
|
||||||
debuglog("poloniex deleting order $coin->name $db_order->amount");
|
debuglog("poloniex deleting order $coin->name $db_order->amount");
|
||||||
$db_order->delete();
|
$db_order->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// add orders
|
// add orders
|
||||||
$savebalance = getdbosql('db_balances', "name='poloniex'");
|
$savebalance = getdbosql('db_balances', "name='poloniex'");
|
||||||
$balances = $poloniex->get_balances();
|
$balances = $poloniex->get_balances();
|
||||||
|
|
||||||
foreach($balances as $symbol=>$balance)
|
foreach($balances as $symbol=>$balance)
|
||||||
{
|
{
|
||||||
if(!$balance) continue;
|
if(!$balance) continue;
|
||||||
if($symbol == 'BTC')
|
if($symbol == 'BTC')
|
||||||
{
|
{
|
||||||
$savebalance->balance = $balance;
|
$savebalance->balance = $balance;
|
||||||
$savebalance->save();
|
$savebalance->save();
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$symbol));
|
$coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$symbol));
|
||||||
if(!$coin || $coin->dontsell) continue;
|
if(!$coin || $coin->dontsell) continue;
|
||||||
|
|
||||||
$market = getdbosql('db_markets', "coinid=$coin->id and name='poloniex'");
|
$market = getdbosql('db_markets', "coinid=$coin->id and name='poloniex'");
|
||||||
if($market)
|
if($market)
|
||||||
{
|
{
|
||||||
$market->lasttraded = time();
|
$market->lasttraded = time();
|
||||||
$market->save();
|
$market->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
$pair = "BTC_$symbol";
|
$pair = "BTC_$symbol";
|
||||||
if(!isset($tickers[$pair])) continue;
|
if(!isset($tickers[$pair])) continue;
|
||||||
|
|
||||||
$sellprice = $tickers[$pair]['highestBid'];
|
$sellprice = $tickers[$pair]['highestBid'];
|
||||||
if($balance * $sellprice < 0.0001) continue;
|
if($balance * $sellprice < 0.0001) continue;
|
||||||
|
|
||||||
// debuglog("poloniex selling $pair, $sellprice, $balance");
|
// debuglog("poloniex selling $pair, $sellprice, $balance");
|
||||||
$res = $poloniex->sell($pair, $sellprice, $balance);
|
$res = $poloniex->sell($pair, $sellprice, $balance);
|
||||||
|
|
||||||
if(!isset($res['orderNumber']))
|
if(!isset($res['orderNumber']))
|
||||||
{
|
{
|
||||||
debuglog($res, 5);
|
debuglog($res, 5);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset($tickers[$pair])) continue;
|
if(!isset($tickers[$pair])) continue;
|
||||||
|
|
||||||
$coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$symbol));
|
$coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$symbol));
|
||||||
if(!$coin) continue;
|
if(!$coin) continue;
|
||||||
|
|
||||||
$db_order = new db_orders;
|
$db_order = new db_orders;
|
||||||
$db_order->market = 'poloniex';
|
$db_order->market = 'poloniex';
|
||||||
$db_order->coinid = $coin->id;
|
$db_order->coinid = $coin->id;
|
||||||
$db_order->amount = $balance;
|
$db_order->amount = $balance;
|
||||||
$db_order->price = $sellprice;
|
$db_order->price = $sellprice;
|
||||||
$db_order->ask = $tickers[$pair]['lowestAsk'];
|
$db_order->ask = $tickers[$pair]['lowestAsk'];
|
||||||
$db_order->bid = $tickers[$pair]['highestBid'];
|
$db_order->bid = $tickers[$pair]['highestBid'];
|
||||||
$db_order->uuid = $res['orderNumber'];
|
$db_order->uuid = $res['orderNumber'];
|
||||||
$db_order->created = time();
|
$db_order->created = time();
|
||||||
$db_order->save();
|
$db_order->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($savebalance->balance >= 0.2)
|
if($savebalance->balance >= 0.2)
|
||||||
{
|
{
|
||||||
$amount = $savebalance->balance; // - 0.0002;
|
$btcaddr = YAAMP_BTCADDRESS; //'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9';
|
||||||
debuglog("poloniex withdraw $amount to 14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9");
|
|
||||||
|
$amount = $savebalance->balance; // - 0.0002;
|
||||||
sleep(1);
|
debuglog("poloniex withdraw $amount to $btcaddr");
|
||||||
|
|
||||||
$res = $poloniex->withdraw('BTC', $amount, '14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9');
|
sleep(1);
|
||||||
debuglog($res);
|
|
||||||
|
$res = $poloniex->withdraw('BTC', $amount, $btcaddr);
|
||||||
if($res && $res->success)
|
debuglog($res);
|
||||||
{
|
|
||||||
$withdraw = new db_withdraws;
|
if($res && $res->success)
|
||||||
$withdraw->market = 'poloniex';
|
{
|
||||||
$withdraw->address = '14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9';
|
$withdraw = new db_withdraws;
|
||||||
$withdraw->amount = $amount;
|
$withdraw->market = 'poloniex';
|
||||||
$withdraw->time = time();
|
$withdraw->address = $btcaddr;
|
||||||
// $withdraw->uuid = $res->result->uuid;
|
$withdraw->amount = $amount;
|
||||||
$withdraw->save();
|
$withdraw->time = time();
|
||||||
}
|
// $withdraw->uuid = $res->result->uuid;
|
||||||
}
|
$withdraw->save();
|
||||||
|
}
|
||||||
// debuglog('-------------- doPoloniexTrading() done');
|
}
|
||||||
}
|
|
||||||
|
// debuglog('-------------- doPoloniexTrading() done');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -292,7 +292,7 @@ class ApiController extends CommonController
|
||||||
// $uptime = system('uptime');
|
// $uptime = system('uptime');
|
||||||
// $name = system('hostname');
|
// $name = system('hostname');
|
||||||
|
|
||||||
// fetch_url("http://yaamp.com/api/nodereport?name=$name&uptime=$uptime");
|
// fetch_url("http://yiimp.ccminer.org/api/nodereport?name=$name&uptime=$uptime");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ class CommonController extends CController
|
||||||
{
|
{
|
||||||
public $admin = false;
|
public $admin = false;
|
||||||
public $memcache;
|
public $memcache;
|
||||||
|
|
||||||
private $t1;
|
private $t1;
|
||||||
|
|
||||||
public function goback($count=-1)
|
public function goback($count=-1)
|
||||||
{
|
{
|
||||||
Javascript("window.history.go($count)");
|
Javascript("window.history.go($count)");
|
||||||
|
@ -16,40 +16,40 @@ class CommonController extends CController
|
||||||
public function beforeAction($action)
|
public function beforeAction($action)
|
||||||
{
|
{
|
||||||
// session_start();
|
// session_start();
|
||||||
|
|
||||||
$this->memcache = new YaampMemcache;
|
$this->memcache = new YaampMemcache;
|
||||||
$this->t1 = microtime(true);
|
$this->t1 = microtime(true);
|
||||||
|
|
||||||
if(user()->getState('yaamp_admin'))
|
if(user()->getState('yaamp_admin'))
|
||||||
$this->admin = true;
|
$this->admin = true;
|
||||||
|
|
||||||
$algo = user()->getState('yaamp-algo');
|
$algo = user()->getState('yaamp-algo');
|
||||||
if(!$algo) user()->setState('yaamp-algo', 'x11');
|
if(!$algo) user()->setState('yaamp-algo', 'x11');
|
||||||
|
|
||||||
|
//$um = app()->getComponent('urlManager');
|
||||||
|
//var_dump($um); die;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function afterAction($action)
|
public function afterAction($action)
|
||||||
{
|
{
|
||||||
// debuglog("after action");
|
// debuglog("after action ".$action->getId());
|
||||||
|
|
||||||
$t2 = microtime(true);
|
$t2 = microtime(true);
|
||||||
$d1 = $t2 - $this->t1;
|
$d1 = $t2 - $this->t1;
|
||||||
|
|
||||||
$url = "$this->id/{$this->action->id}";
|
$url = "$this->id/{$this->action->id}";
|
||||||
$this->memcache->add_monitoring_function($url, $d1);
|
$this->memcache->add_monitoring_function($url, $d1);
|
||||||
|
|
||||||
|
//$um = app()->getComponent('urlManager');
|
||||||
|
//var_dump($um); die;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionMaintenance()
|
public function actionMaintenance()
|
||||||
{
|
{
|
||||||
$this->render('maintenance');
|
$this->render('maintenance');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
GOTO <a href='http://yaamp.com'>YAAMP.COM</a>
|
GOTO <a href='http://yiimp.ccminer.org'>YIIMP</a>
|
||||||
|
|
||||||
<br><br><br><br><br>
|
<br><br><br><br><br>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ require dirname(__FILE__).'/../../ui/lib/pageheader.php';
|
||||||
$renter = getrenterparam(getparam('address'));
|
$renter = getrenterparam(getparam('address'));
|
||||||
if(!$renter) return;
|
if(!$renter) return;
|
||||||
|
|
||||||
$this->pageTitle = "$renter->address | yaamp.com";
|
$this->pageTitle = "$renter->address | yiimp";
|
||||||
|
|
||||||
echo "<div class='main-left-box'>";
|
echo "<div class='main-left-box'>";
|
||||||
echo "<div class='main-left-title'>Transactions from $renter->address</div>";
|
echo "<div class='main-left-title'>Transactions from $renter->address</div>";
|
||||||
|
|
|
@ -2,24 +2,24 @@
|
||||||
|
|
||||||
class SiteController extends CommonController
|
class SiteController extends CommonController
|
||||||
{
|
{
|
||||||
public $defaultAction='index';
|
public $defaultAction='index';
|
||||||
|
|
||||||
///////////////////////////////////////////////////
|
///////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionfrottedessus()
|
public function actionAdmintest()
|
||||||
{
|
{
|
||||||
debuglog("admin login {$_SERVER['REMOTE_ADDR']}");
|
debuglog("admin login {$_SERVER['REMOTE_ADDR']}");
|
||||||
|
|
||||||
user()->setState('yaamp_admin', true);
|
user()->setState('yaamp_admin', true);
|
||||||
$this->redirect("/site/common");
|
$this->redirect("/site/common");
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionCreate()
|
public function actionCreate()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
|
||||||
$coin = new db_coins;
|
$coin = new db_coins;
|
||||||
$coin->txmessage = true;
|
$coin->txmessage = true;
|
||||||
$coin->created = time();
|
$coin->created = time();
|
||||||
|
@ -27,17 +27,17 @@ class SiteController extends CommonController
|
||||||
$coin->difficulty = 1;
|
$coin->difficulty = 1;
|
||||||
$coin->installed = 1;
|
$coin->installed = 1;
|
||||||
$coin->visible = 1;
|
$coin->visible = 1;
|
||||||
|
|
||||||
// $coin->deposit_minimum = 1;
|
// $coin->deposit_minimum = 1;
|
||||||
$coin->lastblock = '';
|
$coin->lastblock = '';
|
||||||
|
|
||||||
if(isset($_POST['db_coins']))
|
if(isset($_POST['db_coins']))
|
||||||
{
|
{
|
||||||
$coin->attributes = $_POST['db_coins'];
|
$coin->attributes = $_POST['db_coins'];
|
||||||
if($coin->save())
|
if($coin->save())
|
||||||
$this->redirect(array('admin'));
|
$this->redirect(array('admin'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->render('coin_form', array('update'=>false, 'coin'=>$coin));
|
$this->render('coin_form', array('update'=>false, 'coin'=>$coin));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ class SiteController extends CommonController
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$coin = getdbo('db_coins', getiparam('id'));
|
$coin = getdbo('db_coins', getiparam('id'));
|
||||||
$txfee = $coin->txfee;
|
$txfee = $coin->txfee;
|
||||||
|
|
||||||
if(isset($_POST['db_coins']))
|
if(isset($_POST['db_coins']))
|
||||||
{
|
{
|
||||||
$coin->attributes = $_POST['db_coins'];
|
$coin->attributes = $_POST['db_coins'];
|
||||||
|
@ -57,17 +57,17 @@ class SiteController extends CommonController
|
||||||
$remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
|
$remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
|
||||||
$remote->settxfee($coin->txfee);
|
$remote->settxfee($coin->txfee);
|
||||||
}
|
}
|
||||||
|
|
||||||
// $this->redirect(array('admin'));
|
// $this->redirect(array('admin'));
|
||||||
$this->goback();
|
$this->goback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->render('coin_form', array('update'=>true, 'coin'=>$coin));
|
$this->render('coin_form', array('update'=>true, 'coin'=>$coin));
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionIndex()
|
public function actionIndex()
|
||||||
{
|
{
|
||||||
if(isset($_GET['address']))
|
if(isset($_GET['address']))
|
||||||
|
@ -102,87 +102,87 @@ class SiteController extends CommonController
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
|
|
||||||
public function actionCurrent_results()
|
public function actionCurrent_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/current_results');
|
$this->renderPartial('results/current_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionHistory_results()
|
public function actionHistory_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/history_results');
|
$this->renderPartial('results/history_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionMining_results()
|
public function actionMining_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/mining_results');
|
$this->renderPartial('results/mining_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionMiners_results()
|
public function actionMiners_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/miners_results');
|
$this->renderPartial('results/miners_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionWallet_results()
|
public function actionWallet_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/wallet_results');
|
$this->renderPartial('results/wallet_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionWallet_miners_results()
|
public function actionWallet_miners_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/wallet_miners_results');
|
$this->renderPartial('results/wallet_miners_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionWallet_graphs_results()
|
public function actionWallet_graphs_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/wallet_graphs_results');
|
$this->renderPartial('results/wallet_graphs_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionGraph_earnings_results()
|
public function actionGraph_earnings_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/graph_earnings_results');
|
$this->renderPartial('results/graph_earnings_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionFound_results()
|
public function actionFound_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/found_results');
|
$this->renderPartial('results/found_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionUser_earning_results()
|
public function actionUser_earning_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/user_earning_results');
|
$this->renderPartial('results/user_earning_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionGraph_hashrate_results()
|
public function actionGraph_hashrate_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/graph_hashrate_results');
|
$this->renderPartial('results/graph_hashrate_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionGraph_user_results()
|
public function actionGraph_user_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/graph_user_results');
|
$this->renderPartial('results/graph_user_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionGraph_price_results()
|
public function actionGraph_price_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/graph_price_results');
|
$this->renderPartial('results/graph_price_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionGraph_assets_results()
|
public function actionGraph_assets_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/graph_assets_results');
|
$this->renderPartial('results/graph_assets_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionGraph_negative_results()
|
public function actionGraph_negative_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/graph_negative_results');
|
$this->renderPartial('results/graph_negative_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionGraph_profit_results()
|
public function actionGraph_profit_results()
|
||||||
{
|
{
|
||||||
$this->renderPartial('results/graph_profit_results');
|
$this->renderPartial('results/graph_profit_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionTitle_results()
|
public function actionTitle_results()
|
||||||
{
|
{
|
||||||
$user = getuserparam(getparam('address'));
|
$user = getuserparam(getparam('address'));
|
||||||
|
@ -190,30 +190,30 @@ class SiteController extends CommonController
|
||||||
{
|
{
|
||||||
$balance = bitcoinvaluetoa($user->balance);
|
$balance = bitcoinvaluetoa($user->balance);
|
||||||
$coin = getdbo('db_coins', $user->coinid);
|
$coin = getdbo('db_coins', $user->coinid);
|
||||||
|
|
||||||
if($coin)
|
if($coin)
|
||||||
echo "$balance $coin->symbol - yaamp.com";
|
echo "$balance $coin->symbol - yiimp";
|
||||||
else
|
else
|
||||||
echo "$balance - yaamp.com";
|
echo "$balance - yiimp";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
echo "yaamp.com";
|
echo YAAMP_SITE_URL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionAbout()
|
public function actionAbout()
|
||||||
{
|
{
|
||||||
$this->render('about');
|
$this->render('about');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionTerms()
|
public function actionTerms()
|
||||||
{
|
{
|
||||||
$this->render('terms');
|
$this->render('terms');
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionAdmin()
|
public function actionAdmin()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
@ -225,9 +225,9 @@ class SiteController extends CommonController
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$this->renderPartial('admin_results');
|
$this->renderPartial('admin_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionConnections()
|
public function actionConnections()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
@ -239,9 +239,9 @@ class SiteController extends CommonController
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$this->renderPartial('connections_results');
|
$this->renderPartial('connections_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionBlock()
|
public function actionBlock()
|
||||||
{
|
{
|
||||||
$this->render('block');
|
$this->render('block');
|
||||||
|
@ -251,9 +251,9 @@ class SiteController extends CommonController
|
||||||
{
|
{
|
||||||
$this->renderPartial('block_results');
|
$this->renderPartial('block_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionEarning()
|
public function actionEarning()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
@ -265,9 +265,9 @@ class SiteController extends CommonController
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$this->renderPartial('earning_results');
|
$this->renderPartial('earning_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionPayments()
|
public function actionPayments()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
@ -279,9 +279,9 @@ class SiteController extends CommonController
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$this->renderPartial('payments_results');
|
$this->renderPartial('payments_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionUser()
|
public function actionUser()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
@ -293,9 +293,9 @@ class SiteController extends CommonController
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$this->renderPartial('user_results');
|
$this->renderPartial('user_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionWorker()
|
public function actionWorker()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
@ -307,9 +307,9 @@ class SiteController extends CommonController
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$this->renderPartial('worker_results');
|
$this->renderPartial('worker_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionVersion()
|
public function actionVersion()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
@ -321,9 +321,9 @@ class SiteController extends CommonController
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$this->renderPartial('version_results');
|
$this->renderPartial('version_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionCommon()
|
public function actionCommon()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
@ -335,9 +335,9 @@ class SiteController extends CommonController
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$this->renderPartial('common_results');
|
$this->renderPartial('common_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionExchange()
|
public function actionExchange()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
@ -349,9 +349,9 @@ class SiteController extends CommonController
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$this->renderPartial('exchange_results');
|
$this->renderPartial('exchange_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionCoin()
|
public function actionCoin()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
@ -363,46 +363,46 @@ class SiteController extends CommonController
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$this->renderPartial('coin_results');
|
$this->renderPartial('coin_results');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionMemcached()
|
public function actionMemcached()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$this->render('memcached');
|
$this->render('memcached');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionMonsters()
|
public function actionMonsters()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$this->render('monsters');
|
$this->render('monsters');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionEmptyMarkets()
|
public function actionEmptyMarkets()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$this->render('emptymarkets');
|
$this->render('emptymarkets');
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionTx()
|
public function actionTx()
|
||||||
{
|
{
|
||||||
$this->renderPartial('tx');
|
$this->renderPartial('tx');
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionResetBlockchain()
|
public function actionResetBlockchain()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$coin = getdbo('db_coins', $_GET['id']);
|
$coin = getdbo('db_coins', $_GET['id']);
|
||||||
$coin->action = 3;
|
$coin->action = 3;
|
||||||
$coin->save();
|
$coin->save();
|
||||||
|
|
||||||
$this->redirect("/site/coin?id=$coin->id");
|
$this->redirect("/site/coin?id=$coin->id");
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionRestartCoin()
|
public function actionRestartCoin()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
@ -414,11 +414,11 @@ class SiteController extends CommonController
|
||||||
$coin->installed = true;
|
$coin->installed = true;
|
||||||
$coin->connections = 0;
|
$coin->connections = 0;
|
||||||
$coin->save();
|
$coin->save();
|
||||||
|
|
||||||
$this->redirect('/site/admin');
|
$this->redirect('/site/admin');
|
||||||
// $this->goback();
|
// $this->goback();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionStartCoin()
|
public function actionStartCoin()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
@ -430,16 +430,16 @@ class SiteController extends CommonController
|
||||||
$coin->installed = true;
|
$coin->installed = true;
|
||||||
$coin->connections = 0;
|
$coin->connections = 0;
|
||||||
$coin->save();
|
$coin->save();
|
||||||
|
|
||||||
$this->redirect('/site/admin');
|
$this->redirect('/site/admin');
|
||||||
// $this->goback();
|
// $this->goback();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionStopCoin()
|
public function actionStopCoin()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$coin = getdbo('db_coins', $_GET['id']);
|
$coin = getdbo('db_coins', $_GET['id']);
|
||||||
|
|
||||||
$coin->action = 2;
|
$coin->action = 2;
|
||||||
$coin->enable = false;
|
$coin->enable = false;
|
||||||
$coin->auto_ready = false;
|
$coin->auto_ready = false;
|
||||||
|
@ -449,12 +449,12 @@ class SiteController extends CommonController
|
||||||
$this->redirect('/site/admin');
|
$this->redirect('/site/admin');
|
||||||
// $this->goback();
|
// $this->goback();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionMakeConfigfile()
|
public function actionMakeConfigfile()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$coin = getdbo('db_coins', $_GET['id']);
|
$coin = getdbo('db_coins', $_GET['id']);
|
||||||
|
|
||||||
$coin->action = 5;
|
$coin->action = 5;
|
||||||
$coin->installed = true;
|
$coin->installed = true;
|
||||||
$coin->save();
|
$coin->save();
|
||||||
|
@ -462,79 +462,79 @@ class SiteController extends CommonController
|
||||||
$this->redirect('/site/admin');
|
$this->redirect('/site/admin');
|
||||||
// $this->goback();
|
// $this->goback();
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionSetauto()
|
public function actionSetauto()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$coin = getdbo('db_coins', $_GET['id']);
|
$coin = getdbo('db_coins', $_GET['id']);
|
||||||
|
|
||||||
$coin->auto_ready = true;
|
$coin->auto_ready = true;
|
||||||
$coin->save();
|
$coin->save();
|
||||||
|
|
||||||
$this->redirect('/site/admin');
|
$this->redirect('/site/admin');
|
||||||
// $this->goback();
|
// $this->goback();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionUnsetauto()
|
public function actionUnsetauto()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$coin = getdbo('db_coins', $_GET['id']);
|
$coin = getdbo('db_coins', $_GET['id']);
|
||||||
|
|
||||||
$coin->auto_ready = false;
|
$coin->auto_ready = false;
|
||||||
$coin->save();
|
$coin->save();
|
||||||
|
|
||||||
$this->redirect('/site/admin');
|
$this->redirect('/site/admin');
|
||||||
// $this->goback();
|
// $this->goback();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionSellBalance()
|
public function actionSellBalance()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$coin = getdbo('db_coins', getiparam('id'));
|
$coin = getdbo('db_coins', getiparam('id'));
|
||||||
$amount = getparam('amount');
|
$amount = getparam('amount');
|
||||||
|
|
||||||
$res = $this->doSellBalance($coin, $amount);
|
$res = $this->doSellBalance($coin, $amount);
|
||||||
|
|
||||||
if(!$res)
|
if(!$res)
|
||||||
$this->redirect('/site/admin');
|
$this->redirect('/site/admin');
|
||||||
else
|
else
|
||||||
$this->redirect('/site/exchange');
|
$this->redirect('/site/exchange');
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionBlockuser()
|
public function actionBlockuser()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
|
||||||
$wallet = getparam('wallet');
|
$wallet = getparam('wallet');
|
||||||
$user = getuserparam($wallet);
|
$user = getuserparam($wallet);
|
||||||
|
|
||||||
$user->is_locked = true;
|
$user->is_locked = true;
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
$this->redirect('/site/monsters');
|
$this->redirect('/site/monsters');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionUnblockuser()
|
public function actionUnblockuser()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
|
||||||
$wallet = getparam('wallet');
|
$wallet = getparam('wallet');
|
||||||
$user = getuserparam($wallet);
|
$user = getuserparam($wallet);
|
||||||
|
|
||||||
$user->is_locked = false;
|
$user->is_locked = false;
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
$this->redirect('/site/monsters');
|
$this->redirect('/site/monsters');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionPayuserscoin()
|
public function actionPayuserscoin()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
|
||||||
$coin = getdbo('db_coins', getiparam('id'));
|
$coin = getdbo('db_coins', getiparam('id'));
|
||||||
if(!$coin)
|
if(!$coin)
|
||||||
{
|
{
|
||||||
|
@ -545,13 +545,13 @@ class SiteController extends CommonController
|
||||||
BackendCoinPayments($coin);
|
BackendCoinPayments($coin);
|
||||||
$this->goback();
|
$this->goback();
|
||||||
}
|
}
|
||||||
|
|
||||||
////
|
////
|
||||||
|
|
||||||
public function actionDeleteEarnings()
|
public function actionDeleteEarnings()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
|
||||||
$coin = getdbo('db_coins', getiparam('id'));
|
$coin = getdbo('db_coins', getiparam('id'));
|
||||||
if(!$coin)
|
if(!$coin)
|
||||||
{
|
{
|
||||||
|
@ -565,37 +565,37 @@ class SiteController extends CommonController
|
||||||
dborun("delete from earnings where coinid=$coin->id");
|
dborun("delete from earnings where coinid=$coin->id");
|
||||||
$this->redirect("/site/admin");
|
$this->redirect("/site/admin");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionDeleteEarning()
|
public function actionDeleteEarning()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
$earning = getdbo('db_earnings', $_GET['id']);
|
$earning = getdbo('db_earnings', $_GET['id']);
|
||||||
$earning->delete();
|
$earning->delete();
|
||||||
|
|
||||||
$this->redirect('/site/earning');
|
$this->redirect('/site/earning');
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionDeleteExchange()
|
public function actionDeleteExchange()
|
||||||
{
|
{
|
||||||
$exchange = getdbo('db_exchange', getiparam('id'));
|
$exchange = getdbo('db_exchange', getiparam('id'));
|
||||||
$unspent = $exchange->quantity;
|
$unspent = $exchange->quantity;
|
||||||
|
|
||||||
$exchange->status = 'deleted';
|
$exchange->status = 'deleted';
|
||||||
$exchange->price = 0;
|
$exchange->price = 0;
|
||||||
$exchange->receive_time = time();
|
$exchange->receive_time = time();
|
||||||
$exchange->save();
|
$exchange->save();
|
||||||
|
|
||||||
// $earnings = getdbolist('db_earnings', "coinid=$exchange->coinid and not cleared order by create_time");
|
// $earnings = getdbolist('db_earnings', "coinid=$exchange->coinid and not cleared order by create_time");
|
||||||
// foreach($earnings as $earning)
|
// foreach($earnings as $earning)
|
||||||
// {
|
// {
|
||||||
// $unspent -= $earning->amount;
|
// $unspent -= $earning->amount;
|
||||||
// $earning->delete();
|
// $earning->delete();
|
||||||
|
|
||||||
// if($unspent <= 0) break;
|
// if($unspent <= 0) break;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
$this->redirect('/site/exchange');
|
$this->redirect('/site/exchange');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -603,16 +603,16 @@ class SiteController extends CommonController
|
||||||
{
|
{
|
||||||
$id = getiparam('id');
|
$id = getiparam('id');
|
||||||
$market = getdbo('db_markets', $id);
|
$market = getdbo('db_markets', $id);
|
||||||
|
|
||||||
if($market)
|
if($market)
|
||||||
{
|
{
|
||||||
$market->lastsent = null;
|
$market->lastsent = null;
|
||||||
$market->save();
|
$market->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->redirect('/site/common');
|
$this->redirect('/site/common');
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public function actionAlgo()
|
public function actionAlgo()
|
||||||
|
@ -627,7 +627,7 @@ class SiteController extends CommonController
|
||||||
|
|
||||||
$this->goback();
|
$this->goback();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionGomining()
|
public function actionGomining()
|
||||||
{
|
{
|
||||||
user()->setState('yaamp-algo', getparam('algo'));
|
user()->setState('yaamp-algo', getparam('algo'));
|
||||||
|
@ -640,11 +640,11 @@ class SiteController extends CommonController
|
||||||
BackendPricesUpdate();
|
BackendPricesUpdate();
|
||||||
$this->goback();
|
$this->goback();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionUninstallCoin()
|
public function actionUninstallCoin()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
|
||||||
$coin = getdbo('db_coins', getiparam('id'));
|
$coin = getdbo('db_coins', getiparam('id'));
|
||||||
if($coin)
|
if($coin)
|
||||||
{
|
{
|
||||||
|
@ -654,7 +654,7 @@ class SiteController extends CommonController
|
||||||
// dborun("delete from markets where coinid=$coin->id");
|
// dborun("delete from markets where coinid=$coin->id");
|
||||||
dborun("delete from orders where coinid=$coin->id");
|
dborun("delete from orders where coinid=$coin->id");
|
||||||
dborun("delete from shares where coinid=$coin->id");
|
dborun("delete from shares where coinid=$coin->id");
|
||||||
|
|
||||||
$coin->enable = false;
|
$coin->enable = false;
|
||||||
$coin->installed = false;
|
$coin->installed = false;
|
||||||
$coin->auto_ready = false;
|
$coin->auto_ready = false;
|
||||||
|
@ -663,14 +663,14 @@ class SiteController extends CommonController
|
||||||
$coin->balance = 0;
|
$coin->balance = 0;
|
||||||
$coin->save();
|
$coin->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->redirect("/site/admin");
|
$this->redirect("/site/admin");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionBanUser()
|
public function actionBanUser()
|
||||||
{
|
{
|
||||||
if(!$this->admin) return;
|
if(!$this->admin) return;
|
||||||
|
|
||||||
$user = getdbo('db_accounts', getiparam('id'));
|
$user = getdbo('db_accounts', getiparam('id'));
|
||||||
if($user)
|
if($user)
|
||||||
{
|
{
|
||||||
|
@ -678,60 +678,60 @@ class SiteController extends CommonController
|
||||||
$user->balance = 0;
|
$user->balance = 0;
|
||||||
$user->save();
|
$user->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->goback();
|
$this->goback();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionOptimize()
|
public function actionOptimize()
|
||||||
{
|
{
|
||||||
BackendOptimizeTables();
|
BackendOptimizeTables();
|
||||||
$this->goback();
|
$this->goback();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionRunExchange()
|
public function actionRunExchange()
|
||||||
{
|
{
|
||||||
$id = getiparam('id');
|
$id = getiparam('id');
|
||||||
$balance = getdbo('db_balances', $id);
|
$balance = getdbo('db_balances', $id);
|
||||||
|
|
||||||
if($balance) switch($balance->name)
|
if($balance) switch($balance->name)
|
||||||
{
|
{
|
||||||
case 'cryptsy':
|
case 'cryptsy':
|
||||||
doCryptsyTrading(true);
|
doCryptsyTrading(true);
|
||||||
updateCryptsyMarkets();
|
updateCryptsyMarkets();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'bittrex':
|
case 'bittrex':
|
||||||
doBittrexTrading(true);
|
doBittrexTrading(true);
|
||||||
updateBittrexMarkets();
|
updateBittrexMarkets();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'c-cex':
|
case 'c-cex':
|
||||||
doCCexTrading(true);
|
doCCexTrading(true);
|
||||||
updateCCexMarkets();
|
updateCCexMarkets();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'yobit':
|
case 'yobit':
|
||||||
doYobitTrading(true);
|
doYobitTrading(true);
|
||||||
updateYobitMarkets();
|
updateYobitMarkets();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'bleutrade':
|
case 'bleutrade':
|
||||||
doBleutradeTrading(true);
|
doBleutradeTrading(true);
|
||||||
updateBleutradeMarkets();
|
updateBleutradeMarkets();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'poloniex':
|
case 'poloniex':
|
||||||
doPoloniexTrading(true);
|
doPoloniexTrading(true);
|
||||||
updatePoloniexMarkets();
|
updatePoloniexMarkets();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
debuglog("runexchange done");
|
debuglog("runexchange done");
|
||||||
$this->redirect("/site/common");
|
$this->redirect("/site/common");
|
||||||
}
|
}
|
||||||
|
@ -743,7 +743,7 @@ class SiteController extends CommonController
|
||||||
// $param = getparam('param');
|
// $param = getparam('param');
|
||||||
// if($param) eval($param);
|
// if($param) eval($param);
|
||||||
// else $param = '';
|
// else $param = '';
|
||||||
|
|
||||||
// $this->render('eval', array('param'=>$param));
|
// $this->render('eval', array('param'=>$param));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -752,7 +752,7 @@ class SiteController extends CommonController
|
||||||
debuglog(__METHOD__);
|
debuglog(__METHOD__);
|
||||||
setcookie('mainbtc', '1', time()+60*60*24, '/');
|
setcookie('mainbtc', '1', time()+60*60*24, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionTest()
|
public function actionTest()
|
||||||
{
|
{
|
||||||
// if(!$this->admin) return;
|
// if(!$this->admin) return;
|
||||||
|
@ -760,13 +760,8 @@ class SiteController extends CommonController
|
||||||
|
|
||||||
$ticker = jubi_api_query('ticker', "?coin=sak");
|
$ticker = jubi_api_query('ticker', "?coin=sak");
|
||||||
debuglog($ticker);
|
debuglog($ticker);
|
||||||
|
|
||||||
debuglog("action test end");
|
debuglog("action test end");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -478,8 +478,10 @@ $immature = bitcoinvaluetoa($immature);
|
||||||
$mints = bitcoinvaluetoa($mints);
|
$mints = bitcoinvaluetoa($mints);
|
||||||
$off = bitcoinvaluetoa($off);
|
$off = bitcoinvaluetoa($off);
|
||||||
|
|
||||||
|
$btcaddr = YAAMP_BTCADDRESS; //'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9';
|
||||||
|
|
||||||
echo "<a href='https://www.okcoin.com/market.do' target=_blank>Bitstamp $mining->usdbtc</a>, ";
|
echo "<a href='https://www.okcoin.com/market.do' target=_blank>Bitstamp $mining->usdbtc</a>, ";
|
||||||
echo "<a href='https://blockchain.info/address/14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9' target=_blank>wallet $btc->balance</a>, next payout $topay2<br>";
|
echo "<a href='https://blockchain.info/address/$btcaddr' target=_blank>wallet $btc->balance</a>, next payout $topay2<br>";
|
||||||
echo "pay $topay, renter $renter, marg $margin, $margin2<br>";
|
echo "pay $topay, renter $renter, marg $margin, $margin2<br>";
|
||||||
echo "mint $mints immature $immature off $off<br>";
|
echo "mint $mints immature $immature off $off<br>";
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ you have from 5 to 15 submits per minute. It's a good trade off between bandwidt
|
||||||
if you want to set the difficulty to 64, you would use:</p>
|
if you want to set the difficulty to 64, you would use:</p>
|
||||||
|
|
||||||
<pre class="main-left-box" style='padding: 3px; font-size: .9em; background-color: #ffffee; font-family: monospace;'>
|
<pre class="main-left-box" style='padding: 3px; font-size: .9em; background-color: #ffffee; font-family: monospace;'>
|
||||||
-o stratum+tcp://yaamp.com:3433 -u wallet_adress -p d=64
|
-o stratum+tcp://yiimp.ccminer.org:3433 -u wallet_adress -p d=64
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p style="width: 700px;">Here are the accepted values for the custom diff:</p>
|
<p style="width: 700px;">Here are the accepted values for the custom diff:</p>
|
||||||
|
|
|
@ -24,12 +24,12 @@ echo <<<END
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
||||||
<div class="main-left-box">
|
<div class="main-left-box">
|
||||||
<div class="main-left-title">YET ANOTHER ANONYMOUS MINING POOL</div>
|
<div class="main-left-title">YII MINING POOL</div>
|
||||||
<div class="main-left-inner">
|
<div class="main-left-inner">
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
||||||
<li>YAAMP is multipool multialgo with auto exchange to Bitcoin or any coin we mine.</li>
|
<li>YIIMP is multipool multialgo with auto exchange to Bitcoin or any coin we mine.</li>
|
||||||
<li>We distribute hashpower in real time among the best coins.</li>
|
<li>We distribute hashpower in real time among the best coins.</li>
|
||||||
<li>No registration required.</li>
|
<li>No registration required.</li>
|
||||||
<li>Just plug in your stratum miner using your bitcoin wallet address as the username.</li>
|
<li>Just plug in your stratum miner using your bitcoin wallet address as the username.</li>
|
||||||
|
@ -53,7 +53,7 @@ echo <<<END
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<p class="main-left-box" style='padding: 3px; font-size: .8em; background-color: #ffffee; font-family: monospace;'>
|
<p class="main-left-box" style='padding: 3px; font-size: .8em; background-color: #ffffee; font-family: monospace;'>
|
||||||
-o stratum+tcp://yaamp.com:PORT -u WALLET_ADDRESS -p xx</p>
|
-o stratum+tcp://yiimp.ccminer.org:PORT -u WALLET_ADDRESS -p xx</p>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>WALLET_ADDRESS can be of any currency we mine or a BTC address.</li>
|
<li>WALLET_ADDRESS can be of any currency we mine or a BTC address.</li>
|
||||||
|
@ -76,9 +76,9 @@ echo <<<END
|
||||||
<li><b>BitcoinTalk</b> - <a href='https://bitcointalk.org/index.php?topic=508786.0' target=_blank >https://bitcointalk.org/index.php?topic=508786.0</a></li>
|
<li><b>BitcoinTalk</b> - <a href='https://bitcointalk.org/index.php?topic=508786.0' target=_blank >https://bitcointalk.org/index.php?topic=508786.0</a></li>
|
||||||
<!--li><b>IRC</b> - <a href='http://webchat.freenode.net/?channels=#yaamp' target=_blank >http://webchat.freenode.net/?channels=#yaamp</a></li-->
|
<!--li><b>IRC</b> - <a href='http://webchat.freenode.net/?channels=#yaamp' target=_blank >http://webchat.freenode.net/?channels=#yaamp</a></li-->
|
||||||
|
|
||||||
<li><b>API</b> - <a href='/site/api'>http://yaamp.com/site/api</a></li>
|
<li><b>API</b> - <a href='/site/api'>http://yiimp.ccminer.org/site/api</a></li>
|
||||||
<li><b>Difficulty</b> - <a href='/site/diff'>http://yaamp.com/site/diff</a></li>
|
<li><b>Difficulty</b> - <a href='/site/diff'>http://yiimp.ccminer.org/site/diff</a></li>
|
||||||
<li><b>Algo Switching</b> - <a href='/site/multialgo'>http://yaamp.com/site/multialgo</a></li>
|
<li><b>Algo Switching</b> - <a href='/site/multialgo'>http://yiimp.ccminer.org/site/multialgo</a></li>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
|
@ -39,11 +39,11 @@ connection will close (and move to your next configured algo) if the algo is not
|
||||||
|
|
||||||
:start
|
:start
|
||||||
|
|
||||||
ccminer.exe -r 0 -a x11 -o stratum+tcp://yaamp.com:3533 -u joe -p x11,x13,x14,x15,quark,lyra2
|
ccminer -r 0 -a x11 -o stratum+tcp://yaamp.com:3533 -u joe -p x11,x13,x14,x15,quark,lyra2
|
||||||
ccminer.exe -r 0 -a x13 -o stratum+tcp://yaamp.com:3633 -u joe -p x11,x13,x14,x15,quark,lyra2
|
ccminer -r 0 -a x13 -o stratum+tcp://yaamp.com:3633 -u joe -p x11,x13,x14,x15,quark,lyra2
|
||||||
ccminer.exe -r 0 -a x15 -o stratum+tcp://yaamp.com:3733 -u joe -p x11,x13,x14,x15,quark,lyra2
|
ccminer -r 0 -a x15 -o stratum+tcp://yaamp.com:3733 -u joe -p x11,x13,x14,x15,quark,lyra2
|
||||||
ccminer.exe -r 0 -a lyra2 -o stratum+tcp://yaamp.com:4433 -u joe -p x11,x13,x14,x15,quark,lyra2
|
ccminer -r 0 -a lyra2 -o stratum+tcp://yaamp.com:4433 -u joe -p x11,x13,x14,x15,quark,lyra2
|
||||||
ccminer.exe -r 0 -a quark -o stratum+tcp://yaamp.com:4033 -u joe -p x11,x13,x14,x15,quark,lyra2
|
ccminer -r 0 -a quark -o stratum+tcp://yaamp.com:4033 -u joe -p x11,x13,x14,x15,quark,lyra2
|
||||||
|
|
||||||
sleep 5000
|
sleep 5000
|
||||||
goto start
|
goto start
|
||||||
|
@ -56,6 +56,7 @@ is the reference with a factor of 1.</p>
|
||||||
<pre class="main-left-box" style='padding: 3px; font-size: .9em; background-color: #ffffee; font-family: monospace;'>
|
<pre class="main-left-box" style='padding: 3px; font-size: .9em; background-color: #ffffee; font-family: monospace;'>
|
||||||
'scrypt' => 1,
|
'scrypt' => 1,
|
||||||
'scryptn' => 0.5,
|
'scryptn' => 0.5,
|
||||||
|
'c11' => 5.5,
|
||||||
'x11' => 5.5,
|
'x11' => 5.5,
|
||||||
'x13' => 3.9,
|
'x13' => 3.9,
|
||||||
'x14' => 3.7,
|
'x14' => 3.7,
|
||||||
|
|
|
@ -5,7 +5,7 @@ require dirname(__FILE__).'/../../ui/lib/pageheader.php';
|
||||||
$user = getuserparam(getparam('address'));
|
$user = getuserparam(getparam('address'));
|
||||||
if(!$user) return;
|
if(!$user) return;
|
||||||
|
|
||||||
$this->pageTitle = "$user->username | yaamp.com";
|
$this->pageTitle = "$user->username | yiimp";
|
||||||
|
|
||||||
$bitcoin = getdbosql('db_coins', "symbol='BTC'");
|
$bitcoin = getdbosql('db_coins', "symbol='BTC'");
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$algo = user()->getState('yaamp-algo');
|
$algo = user()->getState('yaamp-algo');
|
||||||
|
|
||||||
JavascriptFile("/extensions/jqplot/jquery.jqplot.js");
|
JavascriptFile("/extensions/jqplot/jquery.jqplot.js");
|
||||||
|
|
0
web/yaamp/runtime/.gitkeep
Normal file
0
web/yaamp/runtime/.gitkeep
Normal file
|
@ -19,12 +19,12 @@ function auto_page_resume()
|
||||||
function auto_page_refresh()
|
function auto_page_refresh()
|
||||||
{
|
{
|
||||||
page_refresh();
|
page_refresh();
|
||||||
|
|
||||||
var now_time = new Date().getTime();
|
var now_time = new Date().getTime();
|
||||||
if(now_time > auto_start_time + auto_max_time)
|
if(now_time > auto_start_time + auto_max_time)
|
||||||
{
|
{
|
||||||
$('#resume_update_button').show();
|
$('#resume_update_button').show();
|
||||||
document.title = 'yaamp.com';
|
document.title = 'yiimp';
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,26 +1,26 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<!--[if IE 7 ]> <html class="no-js ie ie7 lte7 lte8 lte9" lang="en-US"> <![endif]-->
|
<!--[if IE 7 ]> <html class="no-js ie ie7 lte7 lte8 lte9" lang="en-US"> <![endif]-->
|
||||||
<!--[if IE 8 ]> <html class="no-js ie ie8 lte8 lte9" lang="en-US"> <![endif]-->
|
<!--[if IE 8 ]> <html class="no-js ie ie8 lte8 lte9" lang="en-US"> <![endif]-->
|
||||||
<!--[if IE 9 ]> <html class="no-js ie ie9 lte9>" lang="en-US"> <![endif]-->
|
<!--[if IE 9 ]> <html class="no-js ie ie9 lte9>" lang="en-US"> <![endif]-->
|
||||||
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
|
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
|
|
||||||
<meta name="description" content="yet another anonymous mining pool for bitcoin and altcoin with auto profit switch and auto exchange">
|
<meta name="description" content="yiimp mining pool for bitcoin and altcoin with auto profit switch and auto exchange">
|
||||||
<meta name="keywords" content="anonymous,mining,pool,maxcoin,bitcoin,altcoin,auto,switch,exchange,profit">
|
<meta name="keywords" content="yiimp,anonymous,mining,pool,maxcoin,bitcoin,altcoin,auto,switch,exchange,profit">
|
||||||
|
|
||||||
<title>yaamp.com</title>
|
<title>YiiMP</title>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
echo CHtml::cssFile("/extensions/jquery/themes/ui-lightness/jquery-ui.css");
|
echo CHtml::cssFile("/extensions/jquery/themes/ui-lightness/jquery-ui.css");
|
||||||
echo CHtml::cssFile('/yaamp/ui/css/main.css');
|
echo CHtml::cssFile('/yaamp/ui/css/main.css');
|
||||||
echo CHtml::cssFile('/yaamp/ui/css/table.css');
|
echo CHtml::cssFile('/yaamp/ui/css/table.css');
|
||||||
//echo CHtml::scriptFile('/yaamp/ui/js/jquery.tablesorter.js');
|
//echo CHtml::scriptFile('/yaamp/ui/js/jquery.tablesorter.js');
|
||||||
|
|
||||||
echo CHtml::scriptFile('/extensions/jquery/js/jquery-1.8.3-dev.js');
|
echo CHtml::scriptFile('/extensions/jquery/js/jquery-1.8.3-dev.js');
|
||||||
echo CHtml::scriptFile('/extensions/jquery/js/jquery-ui-1.9.1.custom.min.js');
|
echo CHtml::scriptFile('/extensions/jquery/js/jquery-ui-1.9.1.custom.min.js');
|
||||||
|
|
||||||
echo "</head>";
|
echo "</head>";
|
||||||
|
|
|
@ -18,7 +18,7 @@ echo <<<END
|
||||||
<meta name="description" content="yet another anonymous mining pool for bitcoin and altcoin with auto profit switch and auto exchange">
|
<meta name="description" content="yet another anonymous mining pool for bitcoin and altcoin with auto profit switch and auto exchange">
|
||||||
<meta name="keywords" content="anonymous,mining,pool,maxcoin,bitcoin,altcoin,auto,switch,exchange,profit,scrypt,x11,x13,x14,x15,lyra2,lyra2re,neoscrypt,sha256,quark">
|
<meta name="keywords" content="anonymous,mining,pool,maxcoin,bitcoin,altcoin,auto,switch,exchange,profit,scrypt,x11,x13,x14,x15,lyra2,lyra2re,neoscrypt,sha256,quark">
|
||||||
|
|
||||||
<title>yaamp.com</title>
|
<title>yiimp</title>
|
||||||
|
|
||||||
END;
|
END;
|
||||||
|
|
||||||
|
@ -110,8 +110,8 @@ function showPageHeader()
|
||||||
$mining = getdbosql('db_mining');
|
$mining = getdbosql('db_mining');
|
||||||
$nextpayment = date('H:i', $mining->last_payout+YAAMP_PAYMENTS_FREQ);
|
$nextpayment = date('H:i', $mining->last_payout+YAAMP_PAYMENTS_FREQ);
|
||||||
|
|
||||||
echo "<span style='font-size: .8em;'>Next Payout: $nextpayment EST</span>";
|
echo "<span style='font-size: .8em;'>Next Payout: $nextpayment EUST</span>";
|
||||||
echo " © yaamp.com</span>";
|
echo " © yiimp.ccminer.org</span>";
|
||||||
|
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
|
@ -122,7 +122,7 @@ function showPageFooter()
|
||||||
echo "<div class='footer'>";
|
echo "<div class='footer'>";
|
||||||
$year = date("Y", time());
|
$year = date("Y", time());
|
||||||
|
|
||||||
echo "<p>© $year. All Rights Reserved. yaamp.com -
|
echo "<p>© $year. All Rights Reserved. yiimp -
|
||||||
<a href='/site/terms'>Terms and conditions</a></p>";
|
<a href='/site/terms'>Terms and conditions</a></p>";
|
||||||
|
|
||||||
echo "</div><!-- footer -->";
|
echo "</div><!-- footer -->";
|
||||||
|
|
Loading…
Add table
Reference in a new issue